private void OnTriggerEnter(Collider collider) { if (collider.tag == "Enemy") { EnemyMover monster = collider.gameObject.GetComponent <EnemyMover>(); if (!monster.IsDying()) { gameController.GameOver(false); } } }
void OnTriggerEnter(Collider other) { // End the game if an enemy not in the dying state hits us. if (other.tag == "Enemy") { EnemyMover badGuy = other.gameObject.GetComponent <EnemyMover>(); if (!badGuy.IsDying()) { gameController.GameOver(false); } } }