Aetheria/Assets/Scripts/Gameplay/TimedDestroy.cs
2026-08-10 14:57:50 +01:00

19 lines
No EOL
312 B
C#

using System;
using UnityEngine;
public class TimedDestroy : MonoBehaviour
{
public float Duration;
private float _startTime;
private void Start()
{
_startTime = Time.time;
}
public void Update()
{
if(Time.time - _startTime > Duration) Destroy(gameObject);
}
}