Files
2026-03-04 10:03:45 +08:00

28 lines
418 B
C#

using UnityEngine;
public class DestroyAfterSM : MonoBehaviour
{
public float stayTime = 10f;
private float currenttime;
private bool gameStartItem;
private void Start()
{
if (Time.fixedTime < 1f)
{
gameStartItem = true;
}
currenttime = Time.fixedTime;
}
private void Update()
{
if ((Time.fixedTime - currenttime > stayTime) & !gameStartItem)
{
Object.Destroy(base.gameObject);
}
}
}