private int currentButtonID = -1; //last touched button, for touch mode only public void OnTowerButton(GameObject butObj, int pointerID = -1) { int ID = GetButtonID(butObj); if (UIMainControl.InTouchMode() && !BuildManager.UseDragNDrop()) { if (currentButtonID >= 0) { buttonList[currentButtonID].imgHighlight.enabled = false; } if (currentButtonID != ID) { currentButtonID = ID; buttonList[ID].imgHighlight.enabled = true; OnHoverButton(butObj); return; } ClearTouchModeButton(); } string exception = BuildManager.BuildTower(ID, buildInfo, pointerID); if (exception != "") { UIMessage.DisplayMessage(exception); return; } buildInfo = null; if (!BuildManager.UseDragNDrop()) { Hide(); } }
public void OnUpgradeButton(int index) { if (UIMainControl.InTouchMode()) { if (currentState != 2) { currentState = 2; SetCurrentStateToTwo(index); return; } else { if (currentUpgradeIndex == index) { ClearState(); OnExitUpgradeButton(); } else { SetCurrentStateToTwo(index); return; } } } string exception = currentTower.Upgrade(index); if (exception != "") { UIMessage.DisplayMessage(exception); } }
private int currentButtonID = -1; //last touched button, for touch mode only public void OnAbilityButton(GameObject butObj, int pointerID = -1) { int ID = GetButtonID(butObj); if (UIMainControl.InTouchMode()) { if (currentButtonID >= 0) { buttonList[currentButtonID].imgHighlight.enabled = false; } if (currentButtonID != ID) { //OnAbilitySelectingTarget(true); //to turn on cancel button butCancelCanvasG.alpha = 1; butCancelCanvasG.interactable = true; currentButtonID = ID; buttonList[ID].imgHighlight.enabled = true; OnHoverButton(butObj); return; } ClearTouchModeButton(); } string exception = AbilityManager.SelectAbility(ID, pointerID); if (exception != "") { UIMessage.DisplayMessage(exception); } }
public void OnUpgradeButton(int index) { string exception = currentTower.Upgrade(index); if (exception != "") { UIMessage.DisplayMessage(exception); } }
public void OnPurchaseButton() { //Perk perk=PerkManager.GetPerk(perkItemList[selectID].perkID); string text = PerkManager.PurchasePerk(perkItemList[selectID].perkID); if (text != "") { UIMessage.DisplayMessage(text); return; } UpdatePerkItemList(); UpdateDisplay(); }