What is the appropriate way to cycle through all active gameobjects, and save instance data every ten seconds?
Ideally I would like to create a a singular JSON file that houses all gameobject data, similar to the following:
{
"Instance ID" : " xxxxxx"
"Time" : 10
"Attributes" : [
{ "Position" : "(xx,xx) },
{ "Speed" : "xxx" },
{ "Color" : "xxx" },
]
"Instance ID" : " xxxxxx"
"Time" : 20
"Attributes" : [
{ "Position" : "(xx,xx) },
{ "Speed" : "xxx" },
{ "Color" : "xxx" },
]
...
}
Currently I can save a singular gameobject's data every 10 seconds. However, the inclusion of a secondary gameobject merely overwrites the original JSON file.