Files
Alex38Lyon 878ea46cac update
2025-06-03 12:00:47 +02:00

24 lines
417 B
C#

using UnityEngine;
namespace Unity.FPS.Game
{
public class TimedSelfDestruct : MonoBehaviour
{
public float LifeTime = 1f;
float m_SpawnTime;
void Awake()
{
m_SpawnTime = Time.time;
}
void Update()
{
if (Time.time > m_SpawnTime + LifeTime)
{
Destroy(gameObject);
}
}
}
}