Пример #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();
        }
Пример #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
        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();

            bool exception = true;

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

            if (exception == false)
            {
                UIGameMessage.DisplayMessage("Can't build tower");
            }

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

            Hide();
        }
Пример #4
0
        public void UpgradeTower(int upgradePath = 0)
        {
            string exception = currentTower.Upgrade(upgradePath);

            if (exception == "")
            {
                upgradeOption = 0;
                floatingButtons.SetActive(false);
            }
            else
            {
                UIGameMessage.DisplayMessage(exception);
            }
        }
Пример #5
0
        public void UpgradeTower(int upgradePath = 0)
        {
            bool exception = currentTower.Upgrade(upgradePath);

            if (exception == true)
            {
                upgradeOption = 0;
                floatingButtons.SetActive(false);
            }
            else
            {
                UIGameMessage.DisplayMessage("Insufficient Resource");
            }
        }
Пример #6
0
        private float SpawnWaveFinite()
        {
            if (spawning)
            {
                return(0);
            }


            spawning       = true;
            currentWaveID += 1;


            UIGameMessage.DisplayMessage(waveNames[currentWaveID % waveNames.Count] + " approaching..", 2.5f);

            if (currentWaveID >= waveList.Count)
            {
                return(0);
            }

            Debug.Log("spawning wave" + (currentWaveID + 1));
            if (onNewWaveE != null)
            {
                onNewWaveE(currentWaveID + 1);
            }

            Wave wave = null;

            wave = waveList[currentWaveID];

            if (spawnMode == _SpawnMode.Continous)
            {
                if (currentWaveID < waveList.Count - 1)
                {
                    if (onSpawnTimerE != null)
                    {
                        onSpawnTimerE(wave.duration);
                    }
                }
            }

            for (int i = 0; i < wave.subWaveList.Count; i++)
            {
                StartCoroutine(SpawnSubWave(wave.subWaveList[i], wave));
            }

            return(wave.duration);
        }
Пример #7
0
 // Use this for initialization
 void Awake()
 {
     instance=this;
     txtGameMessageT=txtGameMessage.transform;
     txtGameMessage.SetActive(false);
 }
Пример #8
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
     txtGameMessage.SetActive(false);
 }
Пример #9
0
 // Use this for initialization
 void Awake()
 {
     instance        = this;
     txtGameMessageT = txtGameMessage.transform;
     txtGameMessage.SetActive(false);
 }