void DrawHeader()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.Height(EditorStyles.toolbar.fixedHeight), GUILayout.ExpandWidth(true));
            {
                if (EditorSceneManager_Loader.currentDefinition != null)
                {
                    GUILayout.Label("Root Scene : " + EditorSceneManager_Loader.currentDefinition.PrimaryScene);

                    GUILayout.FlexibleSpace();
                }
                else
                {
                    GUILayout.Label("No Root Scene");
                }

                GUILayout.FlexibleSpace();
                GUI.enabled = EditorSceneManager_Loader.currentDefinition != null;

                if (GUILayout.Button(new GUIContent(addIcon, "Create New Additional Scene"), EditorStyles.toolbarButton, GUILayout.Width(25)))
                {
                    CreateNewScene();
                }

                if (GUILayout.Button(new GUIContent(refreshIcon, "Reload Scenes"), EditorStyles.toolbarButton, GUILayout.Width(25)))
                {
                    EditorSceneManager_Loader.RefreshLoadedScenes();
                }

                GUI.enabled = true;
            }
            EditorGUILayout.EndHorizontal();
        }
        void OnGUI()
        {
            if (EditorApplication.isPlaying)
            {
                DrawPlayMode();
                return;
            }

            DrawHeader();

            if (EditorSceneManager_Loader.currentDefinition == null)
            {
                DrawSceneDefinitionBuilder();
            }
            else
            {
                DrawScenes();
                DragArea();
            }

            if (requiresRefresh)
            {
                requiresRefresh = false;
                EditorSceneManager_Loader.RefreshCurrentSceneDefinition();
            }
        }
        void CreateNewScene()
        {
            SceneAsset newScene = EditorSceneManager_Loader.CreateNewScene();

            if (newScene != null)
            {
                AddScene(newScene);
            }
        }
 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);
     }
 }