Exemple #1
0
        static UnityEngine.SceneManagement.Scene RootScene()
        {
            for (int i = 0; i < EditorSceneManager.loadedSceneCount; i++)
            {
                UnityEngine.SceneManagement.Scene scene = EditorSceneManager.GetSceneAt(i);
                SceneDefinition sceneDefintion          = SceneDefinition_Editor.FromPath(scene.path);
                if (sceneDefintion != null)
                {
                    return(scene);
                }
            }

            return(new UnityEngine.SceneManagement.Scene());
        }
 void DrawSceneDefinitionBuilder()
 {
     if (EditorSceneManager.GetActiveScene().name != "" && EditorSceneManager.GetActiveScene().path != SceneDefinition.entryScenePath)
     {
         if (GUILayout.Button("Create Scene Definition for " + EditorSceneManager.GetActiveScene().name, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
         {
             SceneDefinition_Editor.CreateFromScene(EditorSceneManager.GetActiveScene());
             EditorSceneManager_Loader.RefreshCurrentSceneDefinition();
         }
     }
     else
     {
         EditorGUILayout.HelpBox("No Saved Scene Loaded", MessageType.Warning);
     }
 }
Exemple #3
0
        static SceneDefinition FindSceneDefinition()
        {
            foreach (SceneSetup sceneSetup in EditorSceneManager.GetSceneManagerSetup())
            {
                if (!sceneSetup.isLoaded)
                {
                    continue;
                }

                SceneDefinition sceneDefintion = SceneDefinition_Editor.FromPath(sceneSetup.path);
                if (sceneDefintion != null)
                {
                    return(sceneDefintion);
                }
            }

            return(null);
        }