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(); }
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(); } }
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(); }
public void UpgradeTower(int upgradePath = 0) { string exception = currentTower.Upgrade(upgradePath); if (exception == "") { upgradeOption = 0; floatingButtons.SetActive(false); } else { UIGameMessage.DisplayMessage(exception); } }
public void UpgradeTower(int upgradePath = 0) { bool exception = currentTower.Upgrade(upgradePath); if (exception == true) { upgradeOption = 0; floatingButtons.SetActive(false); } else { UIGameMessage.DisplayMessage("Insufficient Resource"); } }
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); }
// Use this for initialization void Awake() { instance=this; txtGameMessageT=txtGameMessage.transform; txtGameMessage.SetActive(false); }
// Use this for initialization void Awake() { instance = this; txtGameMessage.SetActive(false); }
// Use this for initialization void Awake() { instance = this; txtGameMessageT = txtGameMessage.transform; txtGameMessage.SetActive(false); }