Jump to content

Write code questions using Json Class(USC).


photo

Recommended Posts

Hi,

our json parser currently support only vec2/vec3/vec4 as an array types.

Here an example how you can access this json file

{
  "array_test": [ 0, 0, 1 ]
}

via Unigine Script:

{
	Json j = new Json();
	if (j.load("test.json") == false)
		return;
	
	Json a = j.getChild(0); // Get "array_test" child
	vec3 v = a.getVec3(); // Get it's value

	log.message("%f %f %f\n", v.x, v.y, v.z);
}


Best regards.

  • Thanks 1
Link to comment
×
×
  • Create New...