question

brendan avatar image
brendan asked

show display name

Firestorm Studio
started a topic on Fri, 26 June 2015 at 4:17 AM

Trying to work out how to show a players display name c# unity

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Best Answer
Firestorm Studio said on Fri, 26 June 2015 at 8:07 AM

This seemed to have worked

PlayFabClientAPI.GetAccountInfo (new GetAccountInfoRequest (), OnGetUsernameResult, OnGetUsernameError);


    }

    public void OnGetUsernameResult(GetAccountInfoResult result)
    {
        theLoginScreen.loginStatus.text = "Welcome " + result.AccountInfo.Username;

    }

2 Comments
Firestorm Studio said on Fri, 26 June 2015 at 4:46 AM

this is example of my code

    public string username;

    void Start () 
    {
        GetAccountInfoRequest request = new GetAccountInfoRequest ();
        username = request.Username;
        PlayFabClientAPI.GetAccountInfo (request, OnGetUsernameResult, OnGetUsernameError);
    }

    public void OnGetUsernameResult(GetAccountInfoResult result)
    {
        print (username);
    } 

Firestorm Studio said on Fri, 26 June 2015 at 8:07 AM

This seemed to have worked

PlayFabClientAPI.GetAccountInfo (new GetAccountInfoRequest (), OnGetUsernameResult, OnGetUsernameError);


    }

    public void OnGetUsernameResult(GetAccountInfoResult result)
    {
        theLoginScreen.loginStatus.text = "Welcome " + result.AccountInfo.Username;

    }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.