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(); }
public static bool SelectButton(string _scenePath) { if (!Button(SsmContent.BtnSelect)) { return(false); } SsmAction.SelectScene(_scenePath); return(true); }
public static bool PlayButton(string _scenePath) { if (!Button(SsmContent.BtnPlay)) { return(false); } SsmAction.PlayScene(_scenePath); return(true); }
public static bool LabelButton(string _scenePath) { if (!GUILayout.Button(SsmContent.SceneGUIContent(_scenePath), SsmContent.BtnScene.Style)) { return(false); } SsmAction.OpenScene(_scenePath); return(true); }
public static bool PlayModeButton(string _scenePath) { Color gc = GUI.color; GUI.color = SsmUtility.IsScenePlayedAtStart(_scenePath) ? SsmContent.BtnPlayMode.ActiveColor : gc; if (!Button(SsmContent.BtnPlayMode)) { GUI.color = gc; return(false); } GUI.color = gc; SsmAction.TogglePlayModeStartScene(_scenePath); return(true); }
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(); }