Exemple #1
0
        private static void OnPreferencesGUI(string search)
        {
            ToolbarVisible.DoGUI();
            FullscreenOnPlayEnabled.DoGUI();

            EditorGUILayout.Separator();
            RectSource.DoGUI();

            if (!IsRectModeSupported(RectSource))
            {
                EditorGUILayout.HelpBox("The selected Rect Source mode is not supported on this platform", MessageType.Warning);
            }

            // Custom Rect
            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;
            }

            DisableNotifications.DoGUI();
            KeepFullscreenBelow.DoGUI();
            DisableSceneViewRendering.DoGUI();

            // Mosaic
            if (FullscreenRects.ScreenCount > 1)
            {
                EditorGUILayout.Separator();
                EditorGUILayout.LabelField(MosaicMapping.Content, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;
                GUI.changed = false;
                var mosaicMapping = MosaicMapping.Value;

                for (var i = 0; i < mosaicMapping.Length && i < FullscreenRects.ScreenCount; i++)
                {
                    var val = EditorGUILayout.IntPopup(string.Format("Physical display {0} renders", i + 1), mosaicMapping[i], mosaicDropDownOptions, new [] { 0, 1, 2, 3, 4, 5, 6, 7 });
                    mosaicMapping[i] = val;
                }

                if (GUI.changed)
                {
                    MosaicMapping.SaveValue();
                }
                EditorGUI.indentLevel--;
            }
        }
Exemple #2
0
        private static void OnPreferencesGUI(string search)
        {
            ToolbarVisible.DoGUI();
            FullscreenOnPlayEnabled.DoGUI();

            EditorGUILayout.Separator();
            RectSource.DoGUI();

            if (RectSource.Value == RectSourceMode.AtMousePosition)
            {
                EditorGUILayout.HelpBox("\'At mouse position\' can cause slowdowns on large projects", MessageType.Warning);
            }

            if (!IsRectModeSupported(RectSource))
            {
                EditorGUILayout.HelpBox("The selected placement source mode is not supported on this platform", MessageType.Warning);
            }

            // Custom Rect
            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;
            }

            DisableNotifications.DoGUI();
            KeepFullscreenBelow.DoGUI();
            DisableSceneViewRendering.DoGUI();
            UseGlobalToolbarHiding.DoGUI();

            if (FullscreenUtility.IsLinux)
            {
                using (new EditorGUI.DisabledGroupScope(!FullscreenEditor.Linux.wmctrl.IsInstalled)) {
                    DoNotUseWmctrl.DoGUI();
                }
                if (!FullscreenEditor.Linux.wmctrl.IsInstalled)
                {
                    EditorGUILayout.HelpBox("'wmctrl' not found. Try installing it with 'sudo apt-get install wmctrl'.", MessageType.Warning);
                }
                else
                {
                    EditorGUILayout.HelpBox("Try enabling the option above if you're experiencing any kind of toolbars or offsets " +
                                            "while in fullscreen mode.\nDisabling 'wmctrl' can fix issues on some Linux environments when the window manager " +
                                            "does not handle fullscreen windows properly (I'm looking at you Ubuntu).", MessageType.Info);
                }
            }

            // Mosaic
            if (FullscreenRects.ScreenCount > 1)
            {
                EditorGUILayout.Separator();
                EditorGUILayout.LabelField(MosaicMapping.Content, EditorStyles.boldLabel);
                EditorGUI.indentLevel++;
                GUI.changed = false;
                var mosaicMapping = MosaicMapping.Value;

                for (var i = 0; i < mosaicMapping.Length && i < FullscreenRects.ScreenCount; i++)
                {
                    var val = EditorGUILayout.IntPopup(string.Format("Physical display {0} renders", i + 1), mosaicMapping[i], mosaicDropDownOptions, new [] { 0, 1, 2, 3, 4, 5, 6, 7 });
                    mosaicMapping[i] = val;
                }

                if (GUI.changed)
                {
                    MosaicMapping.SaveValue();
                }
                EditorGUI.indentLevel--;
            }
        }