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(); }
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 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(); }
public void UpgradeTower(int upgradePath = 0) { string exception = currentTower.Upgrade(upgradePath); if (exception == "") { upgradeOption = 0; floatingButtons.SetActive(false); } else { UIGameMessage.DisplayMessage(exception); } }
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(); }