question

William FOns avatar image
William FOns asked

How to show friend avatar in an instantiated prefab ?,How to get friends avatar url ?

Hello I'm following a tutorial and I would like to add to UIFriend prefab the RawImage of the friend avatar.

I have these codes : Playfab friend controller : https://pastebin.com/x7Nwd3Wy

UIDisplayfriend : https://pastebin.com/YQLCCn8k

UIFriend : https://pastebin.com/YGkDG4ce

I know how to change url to texture with StartCoroutine but I can't find how to implement Playfab in the UIFriend code, if I can get a way to understand I would love it as it would help me for the next.

Thanks in advance :)

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

·
Citrus Yan avatar image
Citrus Yan answered

May I know which part you need help with? The result of PlayFabClientAPI.GetFriendsList is passed in the callback, which is OnFriendsListSuccess(GetFriendsListResult result) (line 72 in Playfab friend controller), you can retrieve all friends' info there, avatar url is under GetFriendsListResult -> Friends -> Profile -> AvatarUrl: https://docs.microsoft.com/en-us/rest/api/playfab/client/friend-list-management/getfriendslist?view=playfab-rest#playerprofilemodel

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.