public virtual void UnitDie() { //if (!GameMaster.Player1Hero) //{ if (faction.Equals(Faction.Blue)) { ScoreRegister.AddRedScore(1); } else if (faction.Equals(Faction.Red)) { ScoreRegister.AddBlueScore(1); } if (Interactionable && !this.GetComponent <HerosUnit>()) { GetGUI.DesactivateButtons(); GetGUI.DesctivateProductionBar(); GetGUI.GUIButtons.Clear(); } //} if (GetComponentInChildren <TriggerXp>()) { GetComponentInChildren <TriggerXp>().GiveExp(); } DestroyIt(); }
public override void UnitDie() { // TODO if (faction.Equals(Faction.Blue)) { ScoreRegister.AddRedScore(1); } else if (faction.Equals(Faction.Red)) { ScoreRegister.AddBlueScore(1); } if (Interactionable && !this.GetComponent <HerosUnit>()) { GetGUI.DesactivateButtons(); GetGUI.DesctivateProductionBar(); GetGUI.GUIButtons.Clear(); } //} foreach (Order order in Orders) { if (order.BuildingGhost) { order.BuildingGhost.GetComponent <BuildingGhost>().NbWorkersAssigned--; } } SendMessage("StopAction"); Destroy(SmallHealthBar); Destroy(gameObject); }
public void DesactivateGUI() { GetGUI.DesactivateButtons(); }