//========================= EXPORTING ========================= /* Main method which processing world, objects, scripts * and composing everything in objects which should be used * to save everything in xml. */ private void ProcessWorld() { if (m_ScenesList == null) { m_ScenesList = new List <aScene>(UnityEditor.EditorBuildSettings.scenes.Length); } else { m_ScenesList.Clear(); } string currentScene = EditorApplication.currentScene; aScene tmpScene; m_PrefabsList = ProcessPrefabs(); //Going through all scenes which were mentioned by developer in build settings foreach (UnityEditor.EditorBuildSettingsScene scene in UnityEditor.EditorBuildSettings.scenes) { //If this scene is marked for building purpose if (scene.enabled) { tmpScene = new aScene(); tmpScene.objects = new List <aPrefab>(); tmpScene.filePath = scene.path; tmpScene.sceneName = scene.path.Substring(scene.path.LastIndexOf('/') + 1); tmpScene.sceneName = tmpScene.sceneName.Substring(0, tmpScene.sceneName.Length - 6); EditorApplication.OpenScene(tmpScene.filePath); m_ScenesList.Add(tmpScene); } } EditorApplication.OpenScene(currentScene); }
//========================= EXPORTING ========================= /* Main method which processing world, objects, scripts * and composing everything in objects which should be used * to save everything in xml. */ private void ProcessWorld() { if (m_ScenesList == null) m_ScenesList = new List<aScene>(UnityEditor.EditorBuildSettings.scenes.Length); else m_ScenesList.Clear(); string currentScene = EditorApplication.currentScene; aScene tmpScene; m_PrefabsList = ProcessPrefabs(); //Going through all scenes which were mentioned by developer in build settings foreach (UnityEditor.EditorBuildSettingsScene scene in UnityEditor.EditorBuildSettings.scenes) { //If this scene is marked for building purpose if (scene.enabled) { tmpScene = new aScene(); tmpScene.objects = new List<aPrefab>(); tmpScene.filePath = scene.path; tmpScene.sceneName = scene.path.Substring(scene.path.LastIndexOf('/') + 1); tmpScene.sceneName = tmpScene.sceneName.Substring(0, tmpScene.sceneName.Length - 6); EditorApplication.OpenScene(tmpScene.filePath); m_ScenesList.Add(tmpScene); } } EditorApplication.OpenScene(currentScene); }