void OnTriggerExit(Collider other) { Destroy(other.gameObject); if (other.CompareTag("Boss")) { gamecontroller.BossDED(); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Boss") || other.CompareTag("Enemy") || other.CompareTag("Boundary")) { return; } Destroy(other.gameObject); if (other.CompareTag("Player")) { Instantiate(Player_explosion, other.transform.position, other.transform.rotation); gamecontroller.GameOver(); gamecontroller.RestartButtonActivate(); } Lives--; if (Lives == 0) { gamecontroller.BossDED(); Destroy(gameObject); Instantiate(explosion, transform.position, transform.rotation); gamecontroller.addScore(score_value); gamecontroller.Congratz(); } }