23 lines
290 B
C#
Raw Permalink Normal View History

2025-09-26 00:21:07 +05:00
using UnityEngine;
namespace Projectiles
{
public class DestroyAfter : MonoBehaviour
{
[SerializeField]
private float _delay = 3f;
private float _time;
protected void Update()
{
_time += Time.deltaTime;
if (_time >= _delay)
{
Destroy(gameObject);
}
}
}
}