Ejemplo n.º 1
0
 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();
         }
     }
 }
Ejemplo n.º 2
0
 public void CloseUpgradePopup()
 {
     isActivePopup = false;
     if (upgradeGameObjectActive != null)
     {
         upgradeGameObjectActive = null;
     }
     upgradeGameObject.Close();
 }