Ejemplo n.º 1
0
        private static SettingsProvider RetrieveSettingsProviderShortcuts()
        {
            var sp = new SettingsProvider("Preferences/Fullscreen Editor/Shortcuts", SettingsScope.User, contents.Select(c => c.text));

            sp.footerBarGuiHandler = OnFooterGUI;
            sp.guiHandler          = (search) => {
                EditorGUIUtility.labelWidth = LABEL_WIDTH;
                Shortcut.DoShortcutsGUI();
            };
            return(sp);
        }
Ejemplo n.º 2
0
        private static void OnPreferencesGUI()
        {
            scroll.Value = EditorGUILayout.BeginScrollView(scroll);
            OnPreferencesGUI(string.Empty);
            EditorGUILayout.Separator();

            EditorGUILayout.LabelField("Shortcuts", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            Shortcut.DoShortcutsGUI();
            EditorGUI.indentLevel--;

            EditorGUILayout.EndScrollView();
            OnFooterGUI();
        }
Ejemplo n.º 3
0
        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();
        }