예제 #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));
 }