public void Authenticate(string email, string password, PlayFabAuthTypes type) { _authService.SetDisplayName(null); _authService.AuthType = type; _authService.Email = email; _authService.Password = password; _authService.AuthenticateToPhotonAfterLogin = true; Deferred def = GameAuthSdk.Authenticate(_authService); if (def.isDone) { if (def.isFulfilled) { _onAuthComplete?.Invoke(); } else { Debug.LogError(def.error.Message); _onAuthFail?.Invoke(); } } else { IEnumerator Routine(Deferred aDef) { yield return(aDef.Wait()); if (aDef.isFulfilled) { _onAuthComplete?.Invoke(); } else { Debug.LogError(aDef.error.Message); _onAuthFail?.Invoke(); } } StartCoroutine(routine: Routine(def)); } }
public void Unauthenticate() { GameAuthSdk.Unauthenticate(); }