示例#1
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.GetComponent <Ship>() == owner)
     {
         Debug.Log("Bullet hit owner...");
     }
     else
     {
         explosion = Instantiate(explosionClass, transform.position, Quaternion.identity);
         Destroy(gameObject);
     }
 }
示例#2
0
 IEnumerator Explode(Vector3 position)
 {
     explosion = Instantiate(explosionClass, position, Quaternion.identity);
     Destroy(gameObject);
     yield return(new WaitForSeconds(10));
 }