Exemple #1
0
        public void SuccessfulLogin(LoginResult result)
        {
            // save login in prefs
            PlayerPrefs.SetString("screenName", result.InfoResultPayload.AccountInfo.Username);
            PlayerPrefs.SetString("email", result.InfoResultPayload.AccountInfo.PrivateInfo.Email);


            if (LeagueManager.redirectLoginToLeague)
            {
                SceneManager.LoadScene("LeagueDashboard");
            }
            else
            {
                SceneManager.LoadScene("MainMenu");
            }
            PlayFabAuthenticator.Authenticated(result);
        }
Exemple #2
0
        private void Start()
        {
            if (PlayerPrefs.HasKey("screenName") && PlayerPrefs.HasKey("password"))
            {
                loggedIn = true;

                // player was logged in previously
                TextMeshProUGUI buttonText = accountButton.GetComponentInChildren <TextMeshProUGUI>();
                buttonText.text = PlayerPrefs.GetString("screenName");
                logInButton.SetActive(false);
                accountButton.SetActive(true);

                PlayFabAuthenticator.AuthenticateWithPlayFab(); // get a default device login
            }
            else
            {
                loggedIn = false;

                // player is not fully logged in
                logInButton.SetActive(true);
                accountButton.SetActive(false);
                PlayFabAuthenticator.AuthenticateWithPlayFab(); // get a default device login
            }
        }
Exemple #3
0
 public void OnLogOutButtonPress()
 {
     PlayFabAuthenticator.LogOut();
     SceneManager.LoadScene("MainMenu");
 }