Using unity ,
So how can i check if display name exists?
What i am looking for is the first time the user signs enter his displayname but the next time the user tries to log in i want to say
Hey
if(Displayname == exists ){
then go to next page
}else{
let's add your DisplayName
}
my code so far:
using System.Collections; using System.Collections.Generic; using UnityEngine; using PlayFab; using PlayFab.ClientModels; using UnityEngine.UI; using System; public class PlayFabAccount : MonoBehaviour { public InputField inputPlayerName; public GameObject accountPanel; public void UpdatePlayerName() { // Hole Text aus dem InputFeld string text = inputPlayerName.text; // Wenn das Textfeld nicht leer ist, dann Spielernamen aktualisieren if (text != null) { // Request erstellen var request = new UpdateUserTitleDisplayNameRequest(); request.DisplayName = text.ToString(); // API Anfrage PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnPlayerNameResult, OnPlayFabError); } } public void ChangePanel() { if (accountPanel.activeSelf) { accountPanel.SetActive(false); } else { accountPanel.SetActive(true); } } private void OnPlayFabError(PlayFabError obj) { print("Error: " + obj.Error); } private void OnPlayerNameResult(UpdateUserTitleDisplayNameResult obj) { print("Spielername wurde aktualsiert: " + obj.DisplayName); } }