ZK_Framework/Assets/UniStorm 3.0/Scripts/System/DespawnObjectUniStorm.cs

19 lines
339 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DespawnObjectUniStorm : MonoBehaviour {
public int Seconds = 3;
void OnEnable () {
StartCoroutine(Despawn());
}
IEnumerator Despawn ()
{
yield return new WaitForSeconds(Seconds);
UniStormPool.Despawn(this.gameObject);
}
}