public static JSON SerializeSceneObjects(bool die)
 {
     GameObject[] save = GameObject.FindGameObjectsWithTag("Editor");
     JSON objects = new JSON();
     foreach (GameObject go in save) {
         JSON obj = new JSON();
         obj["name"].str(go.name);
         obj["position"].vec3(go.transform.position);
         objects.Append(obj);
         if(die) {
             GameObject.Destroy(go);
         }
     }
     return objects;
 }
Exemple #2
0
    public static JSON SerializeSceneObjects(bool die)
    {
        GameObject[] save    = GameObject.FindGameObjectsWithTag("Editor");
        JSON         objects = new JSON();

        foreach (GameObject go in save)
        {
            JSON obj = new JSON();
            obj["name"].str(go.name);
            obj["position"].vec3(go.transform.position);
            objects.Append(obj);
            if (die)
            {
                GameObject.Destroy(go);
            }
        }
        return(objects);
    }