- Home /
Question by
coldloc · Jun 28, 2015 at 01:10 PM ·
c#jsonchild object
How to access child element value according to below json structure.
Below is the dump data in json format, Would like to know how to access to Debug.log(text) in the children of the GameObject which is name "LoadButton" in the root;
{
"name": "LoadButton",
"tag": "Untagged",
"layer": "UI",
"active": true,
"position": "(0.0, -325.0, 0.0)",
"image": "FspA04_menu01_Base",
"components": ["RectTransform", "CanvasRenderer", "Image", "Button", ],
"children": [{
"name": "Text",
"tag": "Untagged",
"layer": "UI",
"active": true,
"position": "(38.8, -14.0, 0.0)",
"text": "LOAD",
"components": ["RectTransform", "CanvasRenderer", "Text", "Outline", ],
"children": []
}, ]
},
I think I was able to use GameObject loadbtn = GameObject.Find("LoadButton"); to get the root object, then I would like to know how to display the other json listed elements under this game object.
thanks.
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
JSON vs XML for Unity C# 1 Answer
Making a bubble level (not a game but work tool) 1 Answer
decode json response 1 Answer