rise-and-swine/Assets/Scripts/Assembly-CSharp/TimedDestructor.cs
2023-02-25 23:04:03 -05:00

20 lines
386 B
C#

using System.Collections;
using UnityEngine;
public class TimedDestructor : MonoBehaviour
{
private void Start()
{
base.StartCoroutine(this.DoDestroyCountdown());
}
private IEnumerator DoDestroyCountdown()
{
yield return new WaitForSeconds(this.lifeTime);
UnityEngine.Object.Destroy(base.gameObject);
yield break;
}
[SerializeField]
private float lifeTime = 1f;
}