summaryrefslogtreecommitdiff
path: root/AlienSurvival/Assets/Test/Scripts/TestDestroySelf.cs
blob: 0ab48dadfe6bc601609c665071764aa1cdd14ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
	}

}