1 using UnityEngine;
2 using
System.Collections;
3
4 public
class DestroyAircraft : MonoBehaviour {
5
6     
public GameObject explosion;
7
8     
void OnTriggerEnter(Collider impactObject)
9     {
10         
if (impactObject.tag != "ChaseSensor" && impactObject.tag != "EnemyAI") {
11             
12             Instantiate (explosion, transform.position, transform.rotation);
13             Destroy (transform.parent.parent.gameObject);
14         }
15
16     }
17
18 }


Tìm kết quả nhanh