private static void PreferencesGUI() { if (cp == null) { cp = CreateInstance(typeof(ConfigPreferences)) as ConfigPreferences; } tab = GUILayout.Toolbar(tab, new[] { "B&R", "Config", "Help", "About" }); if (tab != lastTab) { lastTab = tab; GUI.FocusControl(null); } switch (tab) { case 0: showBAR(); break; case 1: { cp.showConfiguration(); Util.Helper.SeparatorUI(); if (GUILayout.Button(new GUIContent(" Reset", Util.Helper.Icon_Reset, "Resets the configuration settings for this project."))) { if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No")) { Util.Config.Reset(); save(); } } GUILayout.Space(6); break; } case 2: cp.showHelp(); break; default: cp.showAbout(); break; } if (GUI.changed) { save(); } }
private static void PreferencesGUI() { if (cp == null) { cp = ScriptableObject.CreateInstance(typeof(ConfigPreferences)) as ConfigPreferences; } tab = GUILayout.Toolbar(tab, new string[] { "B&R", "Config", "Help", "About" }); if (tab != lastTab) { lastTab = tab; GUI.FocusControl(null); } if (tab == 0) { cp.showBAR(); } else if (tab == 1) { cp.showConfiguration(); Helper.SeparatorUI(); if (GUILayout.Button(new GUIContent(" Reset", Helper.Icon_Reset, "Resets the configuration settings for this project."))) { if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Constants.ASSET_NAME + "?", "Yes", "No")) { Config.Reset(); save(); } } GUILayout.Space(6); } else if (tab == 2) { cp.showHelp(); } else { cp.showAbout(); } if (GUI.changed) { save(); } }