void OnTriggerEnter(Collider other) { if (other.tag == "Boundary") { return; } Instantiate(explosion, transform.position, transform.rotation); game_ctrl.Gameover(); Destroy(other.gameObject); Destroy(gameObject); }
void OnTriggerEnter(Collider other) { if (other.tag == "Boundary" || other.tag == "asteroids") { return; } Instantiate(explosion, transform.position, transform.rotation); if (other.tag == "Player") { Instantiate(playerexplosion, other.transform.position, other.transform.rotation); game_ctrl.Gameover(); } game_ctrl.addscore(score); Destroy(other.gameObject); Destroy(gameObject); }