반응형
플레이팹 로그인이 되었다는 가정하에 진행
데이터 가져오기
using PlayFab;
using PlayFab.ClientModels;
using PlayFab.Json;
using PlayFab.ProfilesModels;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayfabManager : MonoBehaviour
{
private void DisplayPlayfabError(PlayFabError error) => Debug.LogError("error : " + error.GenerateErrorReport());
public void GetProfile(string playFabId)
{
string countryCode = "";
string displayName = "";
int score = 0;
PlayFabClientAPI.GetPlayerProfile(new GetPlayerProfileRequest()
{
PlayFabId = playFabId,
ProfileConstraints = new PlayerProfileViewConstraints()
{
ShowLocations = true,
ShowDisplayName = true,
ShowStatistics = true
}
}, result =>
{
countryCode = result.PlayerProfile.Locations[0].CountryCode.Value.ToString();
displayName = result.PlayerProfile.DisplayName;
score = result.PlayerProfile.Statistics.Find(match => match.Name == "Score").Value;
}, DisplayPlayfabError);
}
}
참고할만한 글
반응형
'개발 > Playfab' 카테고리의 다른 글
유니티 플레이팹 서버 시간 가져오기 Playfab GetServerTime 간단 사용법 (0) | 2022.07.12 |
---|---|
유니티 플레이팹 타이틀 데이터 불러오기 Playfab GetTitleInternal 간단 사용법 (0) | 2022.07.12 |
유니티 플레이팹 리더보드 랭킹 불러오기 Playfab LeaderBoard 간단사용법 (0) | 2022.07.08 |
유니티 플레이팹 닉네임 변경, 불러오기 Playfab NickName 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 유저 데이터 불러오기 Playfab GetUserData 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 유저 데이터 가져오기 Playfab SetUserData 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 통계 저장 불러오기 Playfab GetStatistics 간단 사용법 (0) | 2022.07.02 |
유니티 플레이팹 상점 카테고리 가져오기 Playfab GetCatalog 간단 사용법 (0) | 2022.07.02 |
댓글