コード例 #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
ファイル: UI.cs プロジェクト: LiShuJun-spec/dumingjun
        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
ファイル: UITowerInfo.cs プロジェクト: j1mmyto9/TowerDefense
        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
ファイル: SpawnManager.cs プロジェクト: tscheipel/BEER
        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
ファイル: UIGameMessage.cs プロジェクト: lusia8500/2019.10.23
 // Use this for initialization
 void Awake()
 {
     instance        = this;
     txtGameMessageT = txtGameMessage.transform;
     txtGameMessage.SetActive(false);
 }