private void SetActionForButton(Button button, Vector3 newCameraLocation, TabletPosition tabPos, int id) { button.onClick.AddListener(() => { targetLocation = newCameraLocation; UIManager.singleton.setPosition(tabPos); if (tabPos == TabletPosition.Bot || tabPos == TabletPosition.Top) { NetworkEconomySystem.setCurrentTower(World2D.getTowerFromID(id)); } }); }
public void setPosition(TabletPosition pos) { botPanelObject.SetActive(false); position = pos; if (pos == TabletPosition.Bot) { setTopPanelUI(-TOP_PANEL_MAX_Y, 0); } else if (pos == TabletPosition.Top) { setTopPanelUI(TOP_PANEL_MAX_Y, 180); } else { disableUI(); } }