Verified Commit e200e77b authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Updating context and JSON ordering.

parent 608b57c6
This diff is collapsed.
...@@ -61,17 +61,20 @@ public class SceneController : MonoBehaviour ...@@ -61,17 +61,20 @@ public class SceneController : MonoBehaviour
foreach (SemanticBehaviour sb in this.semanticBehaviours) foreach (SemanticBehaviour sb in this.semanticBehaviours)
{ {
JSONObject jsonObject = null; JSONObject jsonObject = null;
if (!sceneDict.ContainsKey( string name = sb.GetComponent<InstanceIdentifier>().name;
if (!sceneDict.ContainsKey(name))
{ {
jsonObject = new JSONObject(); jsonObject = new JSONObject();
jsonObject.Add("name", name);
jsonObject.Add("is_a", new JSONArray()); jsonObject.Add("is_a", new JSONArray());
jsonObject.Add("name", sb.GetComponent<InstanceIdentifier>().name);
jsonObject.Add("components", new JSONObject()); jsonObject.Add("components", new JSONObject());
sceneDict[] = jsonObject; sceneDict[name] = jsonObject;
sceneArray.Add(sceneDict[]); sceneArray.Add(sceneDict[name]);
} }
jsonObject = sceneDict[];
jsonObject = sceneDict[name];
jsonObject["is_a"].Add(sb.is_a); jsonObject["is_a"].Add(sb.is_a);
switch (sb) switch (sb)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment