Hey Guys!
Still Relatively new to Playfab user here... I'm trying to make a scene after my login scene that will check if a user has made a display name yet if so it will reveal a play button for instance and if not you will be prompted to input a display name for your account. but i keep getting a error saying Failed to get Display Name User Not found... Probably my code because i'm still getting used to how to write Playfab API out in C#... Here is my code...
using System.Collections; using System.Collections.Generic; using UnityEngine; using PlayFab; using PlayFab.ClientModels; using UnityEngine.UI; public class CharacterSceneManager : MonoBehaviour { public Text DisplayName; public GameObject NewCharacterPanel; public GameObject CharacterPanel; // Use this for initialization void Start () { GetAccountInfo (); /// WRITE IF STATEMENT SAYING IF DISPALY NAME != NULL THEN SHOW INPUT OBJECT TO SET ONE. } void GetAccountInfo() { PlayFabClientAPI.GetAccountInfo (new GetAccountInfoRequest () { //DISPLAYNAME.TEXT IS A TEXT OBJECT TO DISPLAY PLAYER DISPLAY NAME IF ONE EXISTS... NOT SURE IF THIS IS CORRECT // WAY OF MAKING THAT HAPPEN TitleDisplayName = DisplayName.text, }, result => { print ("Got Display Name"); }, (error) => { print ("Failed To Get Display Name"); #region Display Error Message In Console Debug.Log(error.ErrorMessage); if (error.ErrorDetails != null) { foreach (var ed in error.ErrorDetails) { Debug.Log(string.Format("ErrorDetail: {0}", ed)); var kvp = ed.Value; foreach (var e in kvp ) { Debug.Log(string.Format("ErrorInfo: {0}",e)); } } } #endregion }); } }
Thanks Guys!
-Morgan