Esempio n. 1
0
    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();
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 public void DesactivateGUI()
 {
     GetGUI.DesactivateButtons();
 }