using System.Collections; using System.Collections.Generic; using UnityEngine; namespace RPGCreationKit { /// /// Destroys a GameObject after X seconds. /// public class DestroyAfter : MonoBehaviour { [SerializeField] public float time = 0; DestroyAfter(float time) { this.time = time; } // Update is called once per frame void Start() { Destroy(this.gameObject, time); } } }