- Edited
Hi all, First post here. I'm trying to translate some of my code from GD to C#. I had a JSON file loaded on the fly, parsed and iterated, and I'm trying to do the same thing with C#. This is what I what so far:
file.Open("res://Resources/missions.json", 1);
string text = file.GetAsText();
JSONParseResult dict = JSON.Parse(text);
file.Close();
if(dict.Error != 0){
GD.Print("Error:", dict.ErrorLine);
}else{
Array parsed = dict.Result as Array;
GD.Print(parsed.GetValue(0));
}
How can I iterate this "parsed" array and access string ids?
It contains a JSON like
[{
"board": {
"type": 6,
"floor": 2,
"wall": 5,
"pavement": 2
}, ...]
and it prints ok to the console like. (board:(floor:2), (pavement:2), (type:6), (wall:5))
Any clue?
Thanks in advance