This commit is contained in:
Alex38Lyon
2025-06-03 12:00:47 +02:00
parent ed8041abcd
commit 878ea46cac
1300 changed files with 527178 additions and 0 deletions
@@ -0,0 +1,24 @@
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);
}
}
}
}