Exemple #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);
        }
Exemple #2
0
        void OnFPSMode(bool flag)
        {
            //FPSModeCrosshairObj.SetActive(flag);

                        #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY
            UIGameMessage.DisplayMessage("FPS mode is not supported in mobile");
                        #endif

            if (flag)
            {
                UIBuildButton.Hide();
                UIAbilityButton.Hide();
                UIPerkMenu.Hide();
                UIFPSHUD.Show();
            }
            else
            {
                if (UseDragNDrop())
                {
                    UIBuildButton.Show();
                }
                if (AbilityManager.IsOn())
                {
                    UIAbilityButton.Show();
                }
                if (PerkManager.IsOn())
                {
                    UIPerkMenu.Show();
                }
                UIFPSHUD.Hide();
            }
        }
Exemple #3
0
        void onTowerDeselected()
        {
            UIAbilityButton.AlignButtonBegin();

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

            UIAbilityButton.AlignButtonEnd();
        }
Exemple #4
0
 void OnNewAbility(Ability newAbility)
 {
     Debug.Log("new abiility");
     UIAbilityButton.AddNewAbility(newAbility);
 }
Exemple #5
0
 void Awake()
 {
     instance = this;
     thisObj  = gameObject;
 }