// -------------------------------------------------------------------------------------------- public void WriteUserData(UserData userData, System.Action onSuccess, AccountAuthenticationManager.AuthenticationFailureDelegate onFailure) { // TODO: This is where the player can save their local data to the cloud onSuccess(); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Log in to the local player's account. /// </summary> public void LogIn(AccountAuthenticationManager.AuthenticationSuccessDelegate onSuccess, AccountAuthenticationManager.AuthenticationFailureDelegate onFailure) { _authenticationManager = new PlayFabAccountAuthenticationManager( new List <SessionProvider> { new UnityDeviceIdSessionProvider() }, SystemInfo.deviceUniqueIdentifier, AppConsts.PlayFab.TitleID); _authenticationManager.Authenticate(() => { _accountData = _authenticationManager.AccountData; AuthenticatedSuccessfully?.Invoke(this, new AuthenticatedSuccessfullyEventArgs(_accountData)); onSuccess(); }, (TofuErrorCode errorCode, string errorMessage) => { FailedToAuthenticate?.Invoke(this, EventArgs.Empty); onFailure(errorCode, errorMessage); }); }