Пример #1
0
        public void GetName(string playFabId)
        {
            PlayFab.ClientModels.GetPlayerProfileRequest request = new PlayFab.ClientModels.GetPlayerProfileRequest()
            {
                PlayFabId = playFabId
            };

            PlayFabClientAPI.GetPlayerProfile(request, (result) =>
            {
                //Callback (result.DisplayName);
            },
                                              (error) =>
            {
                Debug.Log(error.ErrorMessage);
            });
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public static void GetPlayerProfile(Action <PlayFab.ClientModels.GetPlayerProfileResult> _playerProfileData, Action _playerProfileResultFailed = null, string playfabId = null)
        {
            var request = new PlayFab.ClientModels.GetPlayerProfileRequest
            {
                ProfileConstraints = new PlayFab.ClientModels.PlayerProfileViewConstraints
                {
                    ShowAvatarUrl             = true,
                    ShowDisplayName           = true,
                    ShowLocations             = true,
                    ShowLastLogin             = true,
                    ShowContactEmailAddresses = true
                },
                PlayFabId = playfabId
            };

            PlayFabClientAPI.GetPlayerProfile(request, _playerProfileData, _OnError =>
            {
                if (_playerProfileResultFailed != null)
                {
                    _playerProfileResultFailed();
                }
            });
        }