Do_Project000/Assets/DO_Studio/D2D_DestroyAfterTime_obi.cs
2017-04-12 01:23:07 +09:00

17 lines
300 B
C#

using UnityEngine;
[AddComponentMenu("Destructible 2D/D2D Destroy After Time")]
public class D2D_DestroyAfterTime_obi : MonoBehaviour
{
public float Seconds = 10.0f;
protected virtual void Update()
{
Seconds -= Time.deltaTime;
if (Seconds <= 0.0f)
{
Destroy(gameObject);
}
}
}