namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets { /// /// Destroys the GameObject it is attached to after a specified amount of time. /// public class DestroySelf : MonoBehaviour { [SerializeField] [Tooltip("The amount of time, in seconds, to wait after Start before destroying the GameObject.")] float m_Lifetime = 0.25f; /// /// The amount of time, in seconds, to wait after Start before destroying the GameObject. /// public float lifetime { get => m_Lifetime; set => m_Lifetime = value; } /// /// See . /// void Start() { Destroy(gameObject, m_Lifetime); } } }