question

Hien Duc avatar image
Hien Duc asked

Help me read Json data

I tried to read Json data but could not display it. Previous examples that were outdated, could not be used. I am using the latest version. Can you check and help me?

https://community.playfab.com/questions/25569/convert-title-data-json-to-different-class-objects.html

Player Data
screenshot-1.png (6.4 KiB)
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

·
jital avatar image
jital answered

Greetings,

The answer in the post you linked only requires a change to line 18 order to work perfectly

From:

 var Enemies = PlayFab.Json.JsonWrapper.DeserializeObject<List<Enemy>>(obj.Data["Enemies"]);

To:

var Enemies = PlayFab.Json.PlayFabSimpleJson.DeserializeObject<List<Enemy>>(obj.Data["Enemies"]);
3 comments
10 |1200

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

Hien Duc avatar image Hien Duc commented ·

I did so in my code. but it can't get the data

0 Likes 0 ·
Hien Duc avatar image Hien Duc commented ·

I want to ask about the recommended Json structure and Entity.

0 Likes 0 ·
jital avatar image jital ♦ commented ·

Instead of the data what did you get? And can you post a sample of your code so I can verify on my end?

0 Likes 0 ·

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.