Files
Cielonos/Assets/External VFXs/MagicArsenal/Demo/Scripts/MagicLoopScript.cs
SoulliesOfficial 649b7a5ddc 更新
2026-05-23 08:27:50 -04:00

33 lines
539 B
C#

using UnityEngine;
using System.Collections;
namespace MagicArsenal {
public class MagicLoopScript : 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();
}
}
}