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); } }
IEnumerator Explode(Vector3 position) { explosion = Instantiate(explosionClass, position, Quaternion.identity); Destroy(gameObject); yield return(new WaitForSeconds(10)); }