Exemplo n.º 1
0
    public void ConfirmLogin_BTN_Click()
    {
        string feedback = UserUtilities.CheckRemoteData(LoginCard_INPT.text, LoginPassword_INPT.text);

        switch (feedback)
        {
        case "BadConnection":
            DisplayNotification(true, "Cannot connect. Please ensure wifi or mobile data connection.");
            break;

        case "Incorrect":
            DisplayNotification(true, "Library card and/or password is incorrect");
            break;

        case "Correct":
            if (RememberMe_TGL.isOn)
            {
                UserUtilities.RememberMeSave();
            }
            else
            {
                UserUtilities.RememberMeDelete();
            }
            GameManager.Instance.SetState(GameManager.GameState.Map);
            if (UserUtilities.User.Active == "New")
            {
                GameObject tut = Instantiate(FirstPlay_Prefab, gameObject.transform);
            }
            if (ShowEULA)
            {
                GameObject eula = Instantiate(Eula_Prefab, gameObject.transform);
            }
            break;

        case "NonExistant":
            DisplayNotification(true, "Library card not registered");
            break;

        case "Empty":
            DisplayNotification(true, "Please enter both a Library card number and a password");
            break;

        case "Error":
            DisplayNotification(true, "Unexpected error. Please try again.");
            break;
        }
    }