Files
Cielonos/Assets/External VFXs/Archanor/Sci-Fi Arsenal/InteractiveDemo/Demo Scripts/SciFiLoopScript.cs
SoulliesOfficial f7af60351b 阶段性完成
2025-12-08 05:27:53 -05:00

34 lines
555 B
C#

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();
}
}
}