반응형
플레이팹 로그인이 되었다는 가정하에 진행
코드 작성
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
{
public string customId = "";
public string nickName = "";
private void DisplayPlayfabError(PlayFabError error) => Debug.LogError("error : " + error.GenerateErrorReport());
public void GetDisplayName()
{
PlayFabClientAPI.GetPlayerProfile(new GetPlayerProfileRequest()
{
PlayFabId = customId,
ProfileConstraints = new PlayerProfileViewConstraints()
{
ShowDisplayName = true
}
},
(result) =>
{
nickName = result.PlayerProfile.DisplayName;
},
DisplayPlayfabError);
}
public void UpdateDisplayName(string nickname)
{
PlayFabClientAPI.UpdateUserTitleDisplayName(new UpdateUserTitleDisplayNameRequest
{
DisplayName = nickname
},
(result) =>
{
Debug.Log("Update User NickName : " + result.DisplayName);
},
DisplayPlayfabError);
}
}
반응형
'개발 > Playfab' 카테고리의 다른 글
유니티 플레이팹 타이틀 뉴스 가져오기 Playfab ReadTitleNews 간단 사용법 (0) | 2022.07.12 |
---|---|
유니티 플레이팹 서버 시간 가져오기 Playfab GetServerTime 간단 사용법 (0) | 2022.07.12 |
유니티 플레이팹 타이틀 데이터 불러오기 Playfab GetTitleInternal 간단 사용법 (0) | 2022.07.12 |
유니티 플레이팹 리더보드 랭킹 불러오기 Playfab LeaderBoard 간단사용법 (0) | 2022.07.08 |
유니티 플레이팹 유저 프로필 가져오기 Playfab GetProfile 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 유저 데이터 불러오기 Playfab GetUserData 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 유저 데이터 가져오기 Playfab SetUserData 간단 사용법 (0) | 2022.07.08 |
유니티 플레이팹 통계 저장 불러오기 Playfab GetStatistics 간단 사용법 (0) | 2022.07.02 |
댓글