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


Gõ tìm kiếm nhanh...