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 OnExitHoverButton(GameObject butObj) { if (GameControl.GetSelectedTower() != null && !GameControl.GetSelectedTower().IsSampleTower()) { return; } BuildManager.ClearSampleTower(); //clear tooltip UITowerInfo.Hide(); }
void Start() { if (GameControl.GetSelectedTower() == null) { foreach (Ability ability in abilityList) { if (ability.belongToHero) { ability.abilityButton.rootObj.SetActive(false); } } } }
public void OnHoverTowerButton(GameObject butObj) { if (GameControl.GetSelectedTower() != null) { return; } int ID = GetButtonID(butObj); UnitTower tower = BuildManager.GetSampleTower(ID); if (!UI.UseDragNDrop()) { BuildManager.ShowSampleTower(ID); } //clear sample //show tooltip UITowerInfo.Show(tower); }
public void OnHoverAbilityButton(GameObject butObj) { //if(FPSControl.IsOn()) return; if (GameControl.GetSelectedTower() != null) { return; } int ID = GetButtonID(butObj); Ability ability = AbilityManager.GetAbilityList()[ID]; txtTooltipName.text = ability.name; txtTooltipCost.text = "Cost:" + ability.cost; txtTooltipDesp.text = ability.GetDesp(); tooltipObj.SetActive(true); }
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(); }