Пример #1
0
        static FullscreenPreferences()
        {
            var rectSourceTooltip = string.Empty;

            rectSourceTooltip += "Controls where Fullscreen views opens.\n\n";
            rectSourceTooltip += "Main Screen: Fullscreen opens on the primary screen;\n\n";
            rectSourceTooltip += "Window Display: Open on the display that the target window is located (Windows only);\n\n";
            rectSourceTooltip += "At Mouse Position: Fullscreen opens on the screen where the mouse pointer is;\n\n";
            rectSourceTooltip += "Span: Fullscreen spans across all screens (Windows only);\n\n";
            rectSourceTooltip += "Custom Rect: Fullscreen opens on the given custom Rect.";

            ToolbarVisible          = new PrefItem <bool>("Toolbar", false, "Toolbar Visible", "Show and hide the toolbar on the top of some windows, like the Game View and Scene View.");
            FullscreenOnPlayEnabled = new PrefItem <bool>("FullscreenOnPlay", false, "Fullscreen On Play", "Override the \"Maximize on Play\" option of the game view to \"Fullscreen on Play\"");
            RectSource           = new PrefItem <RectSourceMode>("RectSource", RectSourceMode.AtMousePosition, "Rect Source", rectSourceTooltip);
            CustomRect           = new PrefItem <Rect>("CustomRect", FullscreenRects.GetMainDisplayRect(), "Custom Rect", string.Empty);
            DisableNotifications = new PrefItem <bool>("DisableNotifications", false, "Disable Notifications", "Disable the notifications that shows up when opening a new fullscreen view.");

            if (FullscreenUtility.MenuItemHasShortcut(Shortcut.TOOLBAR_PATH))
            {
                ToolbarVisible.Content.text += string.Format(" ({0})", FullscreenUtility.TextifyMenuItemShortcut(Shortcut.TOOLBAR_PATH));
            }
            if (FullscreenUtility.MenuItemHasShortcut(Shortcut.FULLSCREEN_ON_PLAY_PATH))
            {
                FullscreenOnPlayEnabled.Content.text += string.Format(" ({0})", FullscreenUtility.TextifyMenuItemShortcut(Shortcut.FULLSCREEN_ON_PLAY_PATH));
            }
        }
Пример #2
0
        static FullscreenPreferences()
        {
            var rectSourceTooltip = string.Empty;

            rectSourceTooltip += "Controls where Fullscreen views opens.\n\n";
            rectSourceTooltip += "Main Screen: Fullscreen opens on the primary screen;\n\n";
            rectSourceTooltip += "Window Display: Open on the display that the target window is located (Windows only);\n\n";
            rectSourceTooltip += "At Mouse Position: Fullscreen opens on the screen where the mouse pointer is;\n\n";
            rectSourceTooltip += "Span: Fullscreen spans across all screens (Windows only);\n\n";
            rectSourceTooltip += "Custom Rect: Fullscreen opens on the given custom Rect.";

            ToolbarVisible          = new PrefItem <bool>("Toolbar", false, "Toolbar Visible", "Show and hide the toolbar on the top of some windows, like the Game View and Scene View.");
            FullscreenOnPlayEnabled = new PrefItem <bool>("FullscreenOnPlay", false, "Fullscreen On Play", "Override the \"Maximize on Play\" option of the game view to \"Fullscreen on Play\"");
            RectSource                = new PrefItem <RectSourceMode>("RectSource", RectSourceMode.AtMousePosition, "Rect Source", rectSourceTooltip);
            CustomRect                = new PrefItem <Rect>("CustomRect", FullscreenRects.GetMainDisplayRect(), "Custom Rect", string.Empty);
            DisableNotifications      = new PrefItem <bool>("DisableNotifications", false, "Disable Notifications", "Disable the notifications that shows up when opening a new fullscreen view.");
            KeepFullscreenBelow       = new PrefItem <bool>("KeepFullscreenBelow", true, "Keep Utility Views Above", "Keep utility views on top of fullscreen views.\nThis is useful to integrate with assets that need to keep windows open, such as Peek by Ludiq.");
            DisableSceneViewRendering = new PrefItem <bool>("DisableSceneViewRendering", true, "Disable Scene View Rendering", "Increase Fullscreen Editor performance by not rendering SceneViews while there are open fullscreen views.");
            MosaicMapping             = new PrefItem <int[]>("MosaicMapping", new [] { 0, 1, 2, 3, 4, 5, 6, 7 }, "Mosaic Screen Mapping", "Defines which display renders on each screen when using Mosaic.");

            onLoadDefaults += () => // Array won't revert automaticaly because it is changed as reference
                              MosaicMapping.Value = new [] { 0, 1, 2, 3, 4, 5, 6, 7 };

            if (FullscreenUtility.MenuItemHasShortcut(Shortcut.TOOLBAR_PATH))
            {
                ToolbarVisible.Content.text += string.Format(" ({0})", FullscreenUtility.TextifyMenuItemShortcut(Shortcut.TOOLBAR_PATH));
            }
            if (FullscreenUtility.MenuItemHasShortcut(Shortcut.FULLSCREEN_ON_PLAY_PATH))
            {
                FullscreenOnPlayEnabled.Content.text += string.Format(" ({0})", FullscreenUtility.TextifyMenuItemShortcut(Shortcut.FULLSCREEN_ON_PLAY_PATH));
            }
        }
Пример #3
0
 public static void DoGUI(this PrefItem <RectSourceMode> pref)
 {
     pref.Value = (RectSourceMode)EditorGUILayout.EnumPopup(pref.Content, pref.Value);
 }
Пример #4
0
 public static void DoGUI(this PrefItem <Rect> pref)
 {
     pref.Value = EditorGUILayout.RectField(pref.Content, pref.Value);
 }
Пример #5
0
 public static void DoGUI(this PrefItem <string> pref)
 {
     pref.Value = EditorGUILayout.TextField(pref.Content, pref.Value);
 }
Пример #6
0
 public static void DoGUI(this PrefItem <bool> pref)
 {
     pref.Value = EditorGUILayout.Toggle(pref.Content, pref.Value);
 }
Пример #7
0
 public static void DoGUI(this PrefItem <float> pref, float min, float max)
 {
     pref.Value = EditorGUILayout.Slider(pref.Content, pref.Value, min, max);
 }
Пример #8
0
 public static void DoGUI(this PrefItem <int> pref, int min, int max)
 {
     pref.Value = EditorGUILayout.IntSlider(pref.Content, pref.Value, min, max);
 }