Пример #1
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();
            }
        }
Пример #2
0
        public void OnPurchaseButton()
        {
            string text = PerkManager.PurchasePerk(itemList[selectedID].perkID);

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

            for (int i = 0; i < itemList.Count; i++)
            {
                if (PerkManager.IsPerkPurchased(itemList[i].perkID))
                {
                    SetToPurchased(itemList[i]);
                }
                else if (PerkManager.IsPerkAvailable(itemList[i].perkID) != "")
                {
                    SetToUnavailable(itemList[i]);
                }
                else
                {
                    SetToNormal(itemList[i]);
                }
            }

            OnItemButton(itemList[selectedID].button.rootObj);

            UpdateDisplay();
        }
Пример #3
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();
        }
Пример #4
0
        // Use this for initialization
        void Awake()
        {
            CanvasGroup cg = GetComponent <CanvasGroup>();

            cg.alpha = 1f;

            instance        = this;
            txtGameMessageT = txtGameMessage.transform;
            txtGameMessage.SetActive(false);
        }
Пример #5
0
        public void UpgradeTower(int upgradePath = 0)
        {
            string exception = currentTower.Upgrade(upgradePath);

            if (exception == "")
            {
                upgradeOption = 0;
                floatingButtons.SetActive(false);
            }
            else
            {
                UIGameMessage.DisplayMessage(exception);
            }
        }
Пример #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();
        }