1 using UnityEngine;
2 using
System.Collections;
3
4 public
class DestroyObject : MonoBehaviour {
5
6     
public GameObject objectToDestroy;
7     
public float destructionDelay;
8
9
10     
// Use this for initialization
11     
void Start () {
12         Invoke (
"DestroyAfterDely", destructionDelay);
13     }
14
15     
void SelfDestruct()
16     {
17         Destroy (gameObject);
18     }
19
20 }


Tìm kết quả nhanh