阶段性完成
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace SciFiArsenal
|
||||
{
|
||||
public class SciFiLoopScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public GameObject chosenEffect;
|
||||
public float loopTimeLimit = 2.0f;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
PlayEffect();
|
||||
}
|
||||
|
||||
|
||||
public void PlayEffect()
|
||||
{
|
||||
StartCoroutine("EffectLoop");
|
||||
}
|
||||
|
||||
|
||||
IEnumerator EffectLoop()
|
||||
{
|
||||
GameObject effectPlayer = (GameObject) Instantiate(chosenEffect, transform.position, transform.rotation);
|
||||
|
||||
yield return new WaitForSeconds(loopTimeLimit);
|
||||
|
||||
Destroy (effectPlayer);
|
||||
PlayEffect();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user