Files
ZeroVR/ZeroPacientVR/Assets/HurricaneVR/Framework/Scripts/Components/HVRDestroyTimer.cs
T
2022-04-18 19:17:20 +03:00

19 lines
432 B
C#

using System.Collections;
using UnityEngine;
namespace HurricaneVR.Framework.Components
{
public class HVRDestroyTimer : MonoBehaviour
{
public void StartTimer(float timeout)
{
StartCoroutine(Cleanup(timeout));
}
private IEnumerator Cleanup(float timeout)
{
yield return new WaitForSeconds(timeout);
Destroy(this.gameObject);
}
}
}