Beispiel #1
0
        void onTowerSelected(UnitTower unit)
        {
            print(unit.unitName + " selected");

            UIAbilityButton.AlignButtonBegin();

            List <Ability> abList = new List <Ability>();

            foreach (UnitStat unitStat in unit.stats)
            {
                if (unitStat.abilityHolder)
                {
                    Ability ability = unitStat.abilityHolder.ability;
                    int     id      = ability.ID;

                    foreach (Ability ab in abilityList)
                    {
                        if (ab.ID == id)
                        {
                            ab.abilityButton.rootObj.SetActive(true);
                        }
                    }
                }
            }
            UIAbilityButton.AlignButtonEnd();

            //BuildAbilityButtons(abList);
        }
Beispiel #2
0
        void onTowerDeselected()
        {
            UIAbilityButton.AlignButtonBegin();

            foreach (Ability ability in abilityList)
            {
                if (ability.belongToHero)
                {
                    ability.abilityButton.rootObj.SetActive(false);
                }
            }

            UIAbilityButton.AlignButtonEnd();
        }