private void Die() { // FIRE EVENT TO GAME MANAGER, IN GAME MANAGER IF ALL THE PLAYERS ARE DEAD, THEN DO THIS HeroDiedEventInfo hdei = new HeroDiedEventInfo(); hdei.EventDescription = "Unit " + this.tag + " has died"; hdei.HeroName = this.gameObject.name; EventSystem.Current.FireEvent(hdei); Destroy(this.gameObject); }
private void HeroDied(HeroDiedEventInfo hdei) { SceneManager.LoadScene("MainScene", LoadSceneMode.Single); }