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 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 OnSellButton() { currentTower.Sell(); UI.ClearSelectedTower(); }