コード例 #1
0
ファイル: AbilityManager.cs プロジェクト: wattson-coder/TD
        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);
        }
コード例 #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();
            }
        }
コード例 #3
0
ファイル: AbilityManager.cs プロジェクト: wattson-coder/TD
        void onTowerDeselected()
        {
            UIAbilityButton.AlignButtonBegin();

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

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