Example #1
0
        public void OnAbilityButton(GameObject butObj)
        {
            //if(FPSControl.IsOn()) return;

            //in drag and drop mode, player could be hitting the button while having an active tower selected
            //if that's the case, clear the selectedTower first. and we can show the tooltip properly
            if (UI.UseDragNDrop() && GameControl.GetSelectedTower() != null)
            {
                UI.ClearSelectedTower();
                return;
            }

            UI.ClearSelectedTower();

            int ID = GetButtonID(butObj);

            string exception = AbilityManager.SelectAbility(ID);

            if (exception != "")
            {
                UIGameMessage.DisplayMessage(exception);
            }

            //Hide();
        }
Example #2
0
        public void OnExitHoverButton(GameObject butObj)
        {
            if (GameControl.GetSelectedTower() != null && !GameControl.GetSelectedTower().IsSampleTower())
            {
                return;
            }

            BuildManager.ClearSampleTower();

            //clear tooltip
            UITowerInfo.Hide();
        }
Example #3
0
 void Start()
 {
     if (GameControl.GetSelectedTower() == null)
     {
         foreach (Ability ability in abilityList)
         {
             if (ability.belongToHero)
             {
                 ability.abilityButton.rootObj.SetActive(false);
             }
         }
     }
 }
Example #4
0
        public void OnHoverTowerButton(GameObject butObj)
        {
            if (GameControl.GetSelectedTower() != null)
            {
                return;
            }

            int ID = GetButtonID(butObj);

            UnitTower tower = BuildManager.GetSampleTower(ID);

            if (!UI.UseDragNDrop())
            {
                BuildManager.ShowSampleTower(ID);
            }                                                             //clear sample

            //show tooltip
            UITowerInfo.Show(tower);
        }
Example #5
0
        public void OnHoverAbilityButton(GameObject butObj)
        {
            //if(FPSControl.IsOn()) return;


            if (GameControl.GetSelectedTower() != null)
            {
                return;
            }

            int     ID      = GetButtonID(butObj);
            Ability ability = AbilityManager.GetAbilityList()[ID];

            txtTooltipName.text = ability.name;
            txtTooltipCost.text = "Cost:" + ability.cost;
            txtTooltipDesp.text = ability.GetDesp();

            tooltipObj.SetActive(true);
        }
Example #6
0
        public void OnTowerButton(GameObject butObj)
        {
            //in drag and drop mode, player could be hitting the button while having an active tower selected
            //if that's the case, clear the selectedTower first. and we can show the tooltip properly
            if (UI.UseDragNDrop() && GameControl.GetSelectedTower() != null)
            {
                UI.ClearSelectedTower();
                return;
            }

            int ID = GetButtonID(butObj);

            List <UnitTower> towerList = BuildManager.GetTowerList();

            string exception = "";

            if (!UI.UseDragNDrop())
            {
                exception = BuildManager.BuildTower(towerList[ID]);
            }
            else
            {
                exception = BuildManager.BuildTowerDragNDrop(towerList[ID]);
            }

            if (exception != "")
            {
                UIGameMessage.DisplayMessage(exception);
            }

            if (!UI.UseDragNDrop())
            {
                OnExitHoverButton(butObj);
            }

            Hide();
        }