public void Request(Action <string> onReceiveDisplayName) { var connectingView = ConnectingView.Show(); PlayFabClientAPI.GetPlayerProfile( new GetPlayerProfileRequest(), _result => { var playerProfile = _result.PlayerProfile; Debug.Log(string.Format("{0}:{1}", playerProfile.PlayerId, playerProfile.DisplayName)); connectingView.Close(); if (onReceiveDisplayName != null) { onReceiveDisplayName(playerProfile.DisplayName); } }, _error => { var report = _error.GenerateErrorReport(); Debug.LogError(report); connectingView.Close(); ErrorDialogView.Show("GetPlayerProfile failed", report, () => { Request(onReceiveDisplayName); }, true); }); }
public void Request(Action <List <PlayerLeaderboardEntry> > onReceiveLeaderboard, Action onCancel = null) { var connectingView = ConnectingView.Show(); var request = new GetLeaderboardRequest { MaxResultsCount = MaxEntriesCount, StatisticName = StatisticName, }; PlayFabClientAPI.GetLeaderboard( request, _result => { DebugLogLeaderboard(_result); connectingView.Close(); onReceiveLeaderboard?.Invoke(_result.Leaderboard); }, _error => { var report = _error.GenerateErrorReport(); Debug.LogError(report); connectingView.Close(); ErrorDialogView.Show("GetLeaderboard failed", report, () => { Request(onReceiveLeaderboard, onCancel); }, onCancel); }); }
public void OnClickOk() { connectingView = ConnectingView.Show(); var request = new UpdateUserTitleDisplayNameRequest { DisplayName = displayNameInputField.text }; PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnUpdateSuccess, OnUpdateFailure); }
void GetTitleData(Action <Dictionary <string, string> > onSuccess) { var connectingView = ConnectingView.Show(); PlayFabClientAPI.GetTitleData( new GetTitleDataRequest(), _result => { DebugLogTitleData(_result); connectingView.Close(); onSuccess?.Invoke(_result.Data); }, _error => { var report = _error.GenerateErrorReport(); Debug.LogError(report); connectingView.Close(); ErrorDialogView.Show("GetTitleData failed", report, () => { GetTitleData(onSuccess); }, true); }); }