mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
23 lines
283 B
C#
23 lines
283 B
C#
using UnityEngine;
|
|
|
|
public class MonoDestroyInTime : MonoBehaviour
|
|
{
|
|
public float time;
|
|
|
|
private float _timer;
|
|
|
|
private void Start()
|
|
{
|
|
_timer = time;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
_timer -= Time.deltaTime;
|
|
if (_timer <= 0f)
|
|
{
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
}
|