Beispiel #1
0
        public new JSONScene ToJSON()
        {
            var json = new JSONScene();

            json.name = sceneName;

            json.resources = JEResource.GenerateJSONResources();

            json.hierarchy = new List <JSONGameObject>();
            foreach (var go in rootGameObjects)
            {
                json.hierarchy.Add(go.ToJSON());
            }

            return(json);
        }
        public static JSONScene GenerateJSONScene()
        {
            // reset the exporter in case there was an error, Unity doesn't cleanly load/unload editor assemblies
            reset();

            JEScene.sceneName = Path.GetFileNameWithoutExtension(EditorApplication.currentScene);
            JEScene scene = JEScene.TraverseScene();

            scene.Preprocess();
            scene.Process();
            scene.PostProcess();

            JSONScene jsonScene = scene.ToJSON() as JSONScene;

            reset();

            return(jsonScene);
        }