diff options
Diffstat (limited to 'AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs')
-rw-r--r-- | AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs b/AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs new file mode 100644 index 0000000..0ab48da --- /dev/null +++ b/AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TestDestroySelf : MonoBehaviour +{ + public float lifeTime; + + void Start() + { + Invoke("DestroySelf", lifeTime); + } + + void DestroySelf() + { + this.gameObject.SetActive(false); + Destroy(this.gameObject); + } + +} |