public static void PreferencesGUI() { // Load the preferences if (!prefsLoaded) { LoadPrefs(); prefsLoaded = true; OnWindowResize(); } settingsScroll = EditorGUILayout.BeginScrollView(settingsScroll, GUILayout.MaxHeight(136)); // Geometry Settings GUILayout.Label("Geometry Editing Settings", EditorStyles.boldLabel); _editMode = (pb_Editor.EditMode)EditorGUILayout.EnumPopup("Default Edit Mode", _editMode); _selectMode = (ProBuilder.SelectMode)EditorGUILayout.EnumPopup("Default Selection Mode", _selectMode); _faceColor = EditorGUILayout.ColorField("Selected Face Color", _faceColor); defaultOpenInDockableWindow = EditorGUILayout.Toggle("Open in Dockable Window", defaultOpenInDockableWindow); GUILayout.Space(4); GUILayout.Label("Texture Editing Settings", EditorStyles.boldLabel); defaultHideFaceMask = EditorGUILayout.Toggle("Hide face mask", defaultHideFaceMask); EditorGUILayout.EndScrollView(); GUILayout.Space(4); GUILayout.Label("Shortcut Settings", EditorStyles.boldLabel); if (GUI.Button(resetRect, "Use defaults")) { ResetToDefaults(); } ShortcutSelectPanel(); ShortcutEditPanel(); // Save the preferences if (GUI.changed) { SetPrefs(); } }
public static void PreferencesGUI() { // Load the preferences if (!prefsLoaded) { LoadPrefs(); prefsLoaded = true; OnWindowResize(); } settingsScroll = EditorGUILayout.BeginScrollView(settingsScroll, GUILayout.MaxHeight(136)); // Geometry Settings GUILayout.Label("Geometry Editing Settings", EditorStyles.boldLabel); _editMode = (pb_Editor.EditMode)EditorGUILayout.EnumPopup("Default Edit Mode", _editMode); _selectMode = (ProBuilder.SelectMode)EditorGUILayout.EnumPopup("Default Selection Mode", _selectMode); _faceColor = EditorGUILayout.ColorField("Selected Face Color", _faceColor); defaultOpenInDockableWindow = EditorGUILayout.Toggle("Open in Dockable Window", defaultOpenInDockableWindow); GUILayout.Space(4); GUILayout.Label("Texture Editing Settings", EditorStyles.boldLabel); defaultHideFaceMask = EditorGUILayout.Toggle("Hide face mask", defaultHideFaceMask); EditorGUILayout.EndScrollView(); GUILayout.Space(4); GUILayout.Label("Shortcut Settings", EditorStyles.boldLabel); if(GUI.Button(resetRect, "Use defaults")) ResetToDefaults(); ShortcutSelectPanel(); ShortcutEditPanel(); // Save the preferences if (GUI.changed) SetPrefs(); }
public static void LoadPrefs() { defaultEditMode = EditorPrefs.GetString("defaultEditMode"); _editMode = pbUtil.ParseEnum(defaultEditMode, _editMode); defaultSelectionMode = EditorPrefs.GetString("defaultSelectionMode"); _selectMode = pbUtil.ParseEnum(defaultSelectionMode, _selectMode); defaultFaceColor = EditorPrefs.GetString("defaultFaceColor"); _faceColor = pbUtil.ColorWithString(defaultFaceColor); if(!EditorPrefs.HasKey("defaultOpenInDockableWindow")) EditorPrefs.SetBool("defaultOpenInDockableWindow", true); defaultHideFaceMask = (EditorPrefs.HasKey("defaultHideFaceMask")) ? EditorPrefs.GetBool("defaultHideFaceMask") : false; defaultOpenInDockableWindow = EditorPrefs.GetBool("defaultOpenInDockableWindow", defaultOpenInDockableWindow); // shortcut defaults are set in pbUtil defaultShortcuts = EditorPrefs.HasKey("defaultShortcuts") ? pbUtil.ParseShortcuts(EditorPrefs.GetString("defaultShortcuts")) : ProBuilder.DefaultShortcuts(); }
public static void LoadPrefs() { defaultEditMode = EditorPrefs.GetString("defaultEditMode"); _editMode = pbUtil.ParseEnum(defaultEditMode, _editMode); defaultSelectionMode = EditorPrefs.GetString("defaultSelectionMode"); _selectMode = pbUtil.ParseEnum(defaultSelectionMode, _selectMode); defaultFaceColor = EditorPrefs.GetString("defaultFaceColor"); _faceColor = pbUtil.ColorWithString(defaultFaceColor); if (!EditorPrefs.HasKey("defaultOpenInDockableWindow")) { EditorPrefs.SetBool("defaultOpenInDockableWindow", true); } defaultHideFaceMask = (EditorPrefs.HasKey("defaultHideFaceMask")) ? EditorPrefs.GetBool("defaultHideFaceMask") : false; defaultOpenInDockableWindow = EditorPrefs.GetBool("defaultOpenInDockableWindow", defaultOpenInDockableWindow); defaultShortcuts = EditorPrefs.HasKey("defaultShortcuts") ? pb_Shortcut.ParseShortcuts(EditorPrefs.GetString("defaultShortcuts")) : pb_Shortcut.DefaultShortcuts(); }