bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/TimedDestructor.cs

20 lines
341 B
C#
Raw Normal View History

2024-02-24 22:40:44 -05:00
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);
}
}