void OnMouseUp() { if (GameManager.instance.gamestate == GAMESTATE.GAMEPLAYING) { if (currentGameObject != gameObject) { CloseAllPopup(); } if (!isActivePopup) { currentGameObject = gameObject; if (player == null) { listPlayer.SetActive(true); isActivePopup = true; gameObjectActive = listPlayer; } else { isActivePopup = true; upgradeGameObject.Open(); upgradeGameObjectActive = upgradeGameObject; } } } if (GameManager.instance.gamestate == GAMESTATE.LOSEGAME || GameManager.instance.gamestate == GAMESTATE.WINGAME) { if (isActivePopup) { CloseUpgradePopup(); CloseListPlayer(); CloseAllPopup(); } } }
public void CloseUpgradePopup() { isActivePopup = false; if (upgradeGameObjectActive != null) { upgradeGameObjectActive = null; } upgradeGameObject.Close(); }