bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/TimedDestructor.cs
2024-02-24 22:40:44 -05:00

19 lines
341 B
C#

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