init
This commit is contained in:
19
Assets/VRTemplateAssets/Scripts/DestroyObject.cs
Normal file
19
Assets/VRTemplateAssets/Scripts/DestroyObject.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.VRTemplate
|
||||
{
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user