コード例 #1
0
 public void ChangeInterface()
 {
     if (state == loginUIState.CREATE_USER) //RETURN BUTTON
     {
         loggingIn = false;
         PlaySound("cancel");
         state = loginUIState.LOGIN;
     }
     else if (state == loginUIState.LOGIN) //CREATE USER BUTTON
     {
         state = loginUIState.CREATE_USER;
     }
     else if (state == loginUIState.CHOOSE_ACTION) //RETURN BUTTON AT CHOOSE ACTION
     {
         loggingIn = false;
         PlaySound("cancel");
         LogOff();
         state = loginUIState.LOGIN;
     }
     else if (state == loginUIState.CHOOSE_TEAM) // RETURN BUTTON AT CHOOSE TEAM
     {
         PlaySound("cancel");
         state = loginUIState.CHOOSE_ACTION;
     }
 }
コード例 #2
0
    IEnumerator CreateUserLoginCoroutine()
    {
        getPHP.CreateUser(nameInput.text, passInput.text, emailInput.text);
        int nCounter = numTries;

        while (!GetPHP.jobIsDone && nCounter > 0)
        {
            yield return(null);

            nCounter--;
        }

        GetPHP.jobIsDone = false;
        if (nCounter == 0)
        {
            StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, null, "cancel"));
        }
        else
        {
            StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, "confirm", null));
            state = loginUIState.LOGIN;
        }
    }
コード例 #3
0
 private void Start()
 {
     loadedInfo.grades = new int[3];
     getPHP            = GetComponent <GetPHP>();
     state             = loginUIState.LOGIN;
 }
コード例 #4
0
    IEnumerator LoginCoroutine()
    {
        StartCoroutine(givePlayerTextFeedback("Entrando...", "confirm", null));
        getPHP.FindUser(loginNameInput.text, loginPassInput.text);

        int nCounter = numTries;

        while (getPHP.currentPlayerData.error == true && nCounter > 0)
        {
            yield return(null);

            nCounter--;
        }
        if (nCounter == 0)
        {
            StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, null, "cancel"));
        }
        else
        {
            StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, null, null));
            getPHP.CheckIfSessaoExists(getPHP.currentPlayerData.name);

            nCounter = numTries;
            while (getPHP.currentIdData.error == true && nCounter > 0)
            {
                yield return(null);

                nCounter--;
            }
            if (nCounter == 0)
            {
                StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, "cancel", null));
            }
            else
            {
                StartCoroutine(givePlayerTextFeedback(GetPHP.returnMessage, null, null));
                UpdateLoadedInfo();
                chooseActionPanelText[0].text = loadedInfo.name;
                if (loadedInfo.idSession != 0 && loadedInfo.team != 2)
                {
                    chooseActionPanelText[1].text = SceneLoader.ConvMusicIndexToName(loadedInfo.team, loadedInfo.music);
                    chooseActionContinuarButton.gameObject.SetActive(true);
                    chooseActionPanelText[1].gameObject.SetActive(true);
                    chooseActionPanelText[2].gameObject.SetActive(true);
                    if (loadedInfo.team == 0)
                    {
                        chooseActionPanelText[2].text = "GARANTIDO";
                    }
                    else if (loadedInfo.team == 1)
                    {
                        chooseActionPanelText[2].text = "CAPRICHOSO";
                    }
                }
                else
                {
                    chooseActionContinuarButton.gameObject.SetActive(false);
                    chooseActionPanelText[1].gameObject.SetActive(false);
                    chooseActionPanelText[2].gameObject.SetActive(false);
                }

                state = loginUIState.CHOOSE_ACTION;
            }
        }

        loggingIn = false;
    }
コード例 #5
0
 public void NewGameButtonClicked()
 {
     PlaySound("confirm");
     state = loginUIState.CHOOSE_TEAM;
 }