private static Shortcut DrawShortcut(Shortcut shortcut) { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(shortcut.Label, GUILayout.Width(130f)); shortcut.Ctrl = GUILayout.Toggle(shortcut.Ctrl, FullscreenUtility.IsMacOS ? "Cmd" : "Ctrl", EditorStyles.miniButtonLeft, GUILayout.Width(50f)); shortcut.Shift = GUILayout.Toggle(shortcut.Shift, "Shift", EditorStyles.miniButtonMid, GUILayout.Width(50f)); shortcut.Alt = GUILayout.Toggle(shortcut.Alt, "Alt", EditorStyles.miniButtonRight, GUILayout.Width(50f)); shortcut.KeyCode = EditorGUILayout.Popup(shortcut.KeyCode, keys); if (GUILayout.Button(new GUIContent("X", "Clear Shortcut"))) { shortcut.Ctrl = false; shortcut.Shift = false; shortcut.Alt = false; shortcut.KeyCode = 0; } } return(shortcut); }
private static void OnPreferencesGUI(string search) { if (FullscreenUtility.IsLinux) { EditorGUILayout.HelpBox("This plugin was not tested on Linux and its behaviour is unknown.", MessageType.Warning); } EditorGUILayout.Separator(); #if !UNITY_2018_3_OR_NEWER scroll.Value = EditorGUILayout.BeginScrollView(scroll); #endif EditorGUILayout.Separator(); ToolbarVisible.DoGUI(); FullscreenOnPlayEnabled.DoGUI(); EditorGUILayout.Separator(); RectSource.DoGUI(); DisableNotifications.DoGUI(); if (!IsRectModeSupported(RectSource)) { EditorGUILayout.HelpBox("The selected Rect Source mode is not supported on this platform", MessageType.Warning); } switch (RectSource.Value) { case RectSourceMode.Custom: EditorGUI.indentLevel++; CustomRect.DoGUI(); var customRect = CustomRect.Value; if (customRect.width < 300f) { customRect.width = 300f; } if (customRect.height < 300f) { customRect.height = 300f; } CustomRect.Value = customRect; EditorGUI.indentLevel--; break; } EditorGUILayout.Separator(); Shortcut.DoShortcutsGUI(); #if !UNITY_2018_3_OR_NEWER EditorGUILayout.EndScrollView(); #endif GUILayout.FlexibleSpace(); Func <GUIContent, bool> linkLabel = (label) => typeof(EditorGUILayout).InvokeMethod <bool>("LinkLabel", label, new GUILayoutOption[0]); using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (linkLabel(new GUIContent("Consider leaving a review if you're enjoying Fullscreen Editor!", ASSET_STORE_PAGE))) { Application.OpenURL(ASSET_STORE_PAGE); } GUILayout.FlexibleSpace(); } using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); for (var i = 0; i < links.Length; i++) { if (linkLabel(links[i])) { Application.OpenURL(links[i].tooltip); } GUILayout.Space(5f); } GUILayout.FlexibleSpace(); } EditorGUILayout.Separator(); using (new EditorGUILayout.HorizontalScope()) { if (GUILayout.Button(resetSettingsContent, GUILayout.Width(120f))) { onLoadDefaults(); } GUILayout.FlexibleSpace(); EditorGUILayout.LabelField(versionContent, GUILayout.Width(170f)); } EditorGUILayout.Separator(); }