Unity json parser

0 votes
Hello, When i query document, i receive jsonDoc but always a string, is there parser for Unity? i want to get value by key like: string name = jsonDoc.GetString("name"); float score = jsonDoc.GetFloat("score"); ... Thanks!
asked Jul 14, 2016 in Unity by copangtnc (45 points)

2 Answers

+1 vote

You can do that : (I don't know yout json structur)

using LitJson;


JsonData jsonMedias; 

jsonMedias = JsonMapper.ToObject(jsonDoc);

string score = jsonMedias["score"].ToString():



 

answered Jul 14, 2016 by ibompuis (20 points)
0 votes
Thanks, it's worked!
answered Jul 21, 2016 by copangtnc (45 points)
Your welcom :-)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...