private void UnusedSceneGUI(string scenePath, ref EditorBuildSettingsScene[] context) { Color gc = GUI.color; EditorGUILayout.BeginHorizontal(); // Is active ? GUI.color = SsmUtility.IsActive(scenePath) ? Color.yellow : gc; // Select Scene SsmGUI.SelectButton(scenePath); // Add Scene GUI.color = gc; if (SsmGUI.Button(SsmContent.BtnAdd)) { SsmAction.AddSceneInBuild(scenePath, ref context); } // Is active ? GUI.color = SsmUtility.IsActive(scenePath) ? Color.yellow : gc; // Button to open it (Label) SsmGUI.LabelButton(scenePath); GUI.color = gc; // Play button SsmGUI.PlayModeButton(scenePath); SsmGUI.PlayButton(scenePath); EditorGUILayout.EndHorizontal(); }
private void EnabledSceneGUI() { var activeScene = EditorSceneManager.GetActiveScene(); var scenes = EditorBuildSettings.scenes; // Build scenes BuildScenesTitleGUI(); if (scenes.Length > 0) { buildScrollPosition = EditorGUILayout.BeginScrollView(buildScrollPosition, GetBuildScenesHeightOption(scenes.Length)); SceneListGUI(ref scenes); EditorGUILayout.EndScrollView(); } else { SsmGUI.NoSceneInBuildSettings(); } // Other scenes OtherScenesTitleGUI(); otherScrollPosition = EditorGUILayout.BeginScrollView(otherScrollPosition, GUILayout.ExpandHeight(true)); UnusedScenesGUI(ref scenes); GUILayout.EndScrollView(); EditorBuildSettings.scenes = scenes; }
private void BuildScenesTitleGUI() { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Scenes in build"); GUILayout.FlexibleSpace(); SsmGUI.BuildSettingsButton(); EditorGUILayout.EndHorizontal(); }
private void SceneGUI(ref EditorBuildSettingsScene[] context, int index, ref int buildIndex) { EditorBuildSettingsScene scene = context[index]; Color gc = GUI.color; EditorGUILayout.BeginHorizontal(); // Is active ? GUI.color = SsmUtility.IsActive(scene.path) ? Color.yellow : gc; // Select Scene SsmGUI.SelectButton(scene.path); GUI.color = gc; // Remove Scene if (SsmGUI.Button(SsmContent.BtnRemove)) { SsmAction.RemoveSceneInBuild(scene.path, ref context); } // Is active ? GUI.color = SsmUtility.IsActive(scene.path) ? Color.yellow : gc; // Enable toggle / Build index var content = SsmContent.BtnIndex.Content; content.text = scene.enabled ? buildIndex.ToString() : ""; if (GUILayout.Button(content, SsmContent.BtnIndex.Style, SsmContent.BtnIndex.Width)) { SsmAction.ToggleSceneEnabling(ref scene); } buildIndex = scene.enabled ? buildIndex + 1 : buildIndex; // Button to open it (Label) SsmGUI.LabelButton(scene.path); GUI.color = gc; // Play button SsmGUI.PlayModeButton(scene.path); SsmGUI.PlayButton(scene.path); EditorGUILayout.EndHorizontal(); }