Hey , I am trying to display my username that my player created when they register/login in the game , but I'm very confuse how to do it. I look over the documentation but still I don't know how I can do it. This is the script I am using and I am using Photon too. I was thinking to create this game object "displayName" to the player but I don't know how to make it work with this script that I have..
using System.Collections; using System.Collections.Generic; using UnityEngine; using PlayFab; using PlayFab.ClientModels; using UnityEngine.UI; using Photon.Pun; using Photon.Realtime; using System; public class PlayFabAuth : MonoBehaviour { public MPManager mp; public InputField user; public InputField pass; public InputField email; public Text message; public bool IsAuthenticated = false; LoginWithPlayFabRequest loginRequest; // Start is called before the first frame update void Start() { PlayFabSettings.TitleId = "D36F6"; email.gameObject.SetActive(false); } // Update is called once per frame public void Login() { loginRequest = new LoginWithPlayFabRequest(); loginRequest.Username = user.text; loginRequest.Password = pass.text; PlayFabClientAPI.LoginWithPlayFab(loginRequest, result => { IsAuthenticated = true; mp.ConnectToMaster(); message.text = "Welcome " + user.text + ", Conecting.."; Debug.Log("You are now logged in"); }, error => { IsAuthenticated = false; message.text = "Failed to login[" + error.ErrorMessage + "]"; email.gameObject.SetActive(true); Debug.Log(error.ErrorMessage); }, null); } public void Register(){ RegisterPlayFabUserRequest request= new RegisterPlayFabUserRequest(); request.Email = email.text; request.Username = user.text; request.Password = pass.text; PlayFabClientAPI.RegisterPlayFabUser(request, result => { message.text = "Your account has been created"; }, error => { message.text = "Failed to create your account[" + error.ErrorMessage +"]"; }); } }