Stratasys-450mc-VR/Assets/XRI_Examples/Global/Scripts/DestroyObject.cs

18 lines
393 B
C#

namespace UnityEngine.XR.Content.Interaction
{
/// <summary>
/// Destroys GameObject after a few seconds.
/// </summary>
public class DestroyObject : MonoBehaviour
{
[SerializeField]
[Tooltip("Time before destroying in seconds.")]
float m_Lifetime = 5f;
void Start()
{
Destroy(gameObject, m_Lifetime);
}
}
}