Files
CityOfTheDead.Unity/Assets/Scripts/SelfDestroy.cs
T

19 lines
349 B
C#
Raw Normal View History

2025-05-13 05:05:49 +03:00
using UnityEngine;
using System.Collections;
public class SelfDestroy : MonoBehaviour {
private float startTime;
public float Delay = 1;
// Use this for initialization
void Start () {
startTime = Time.time;
}
// Update is called once per frame
void Update () {
if (Time.time >= startTime + Delay) {
Destroy(gameObject);
}
}
}