/// <summary> /// When an explosion touch the player /// </summary> public void TouchByExplosion() { if (isAlive) { this.isAlive = false; //TODO : Play Death Animation //Play player death sound: SoundManager.instance.RandomizeSfx(sound_player_death); Debug.Log(this.gameObject.name + " has been DELETED"); Destroy(this.gameObject); //Inform the Application Controller that the ia died: GameObject appController = GameObject.Find("AppController"); VictoryManager victoryManager = appController.GetComponent <VictoryManager>(); victoryManager.iaDied(); } }