Example #1
0
            public override void OnPreferenceGUI()
            {
                const string title = "Simulator";

                if (canSupport)
                {
                    support = m_foldouter.ShowFoldoutButtonOnToggleEnabled(new GUIContent(title, "If checked, the simulator will activated automatically if no other valid VR devices found."), support);
                }
                else
                {
                    Foldouter.ShowFoldoutBlankWithDisbledToggle(new GUIContent(title));
                }

                if (support && m_foldouter.isExpended)
                {
                    if (support)
                    {
                        EditorGUI.BeginChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = false;
                    }
                    {
                        EditorGUI.indentLevel += 2;
                        VIUSettings.simulatorAutoTrackMainCamera        = EditorGUILayout.ToggleLeft(new GUIContent("Enable Auto Camera Tracking", "Main camera only"), VIUSettings.simulatorAutoTrackMainCamera);
                        VIUSettings.enableSimulatorKeyboardMouseControl = EditorGUILayout.ToggleLeft(new GUIContent("Enable Keyboard-Mouse Control", "You can also control Simulator devices by handling VRModule.Simulator.onUpdateDeviceState event."), VIUSettings.enableSimulatorKeyboardMouseControl);

                        if (!VIUSettings.enableSimulatorKeyboardMouseControl && support)
                        {
                            GUI.enabled = false;
                        }
                        {
                            EditorGUI.indentLevel++;
                            VIUSettings.simulateTrackpadTouch     = EditorGUILayout.Toggle(new GUIContent("Simulate Trackpad Touch", VIUSettings.SIMULATE_TRACKPAD_TOUCH_TOOLTIP), VIUSettings.simulateTrackpadTouch);
                            VIUSettings.simulatorKeyMoveSpeed     = EditorGUILayout.DelayedFloatField(new GUIContent("Keyboard Move Speed", VIUSettings.SIMULATOR_KEY_MOVE_SPEED_TOOLTIP), VIUSettings.simulatorKeyMoveSpeed);
                            VIUSettings.simulatorKeyRotateSpeed   = EditorGUILayout.DelayedFloatField(new GUIContent("Keyboard Rotate Speed", VIUSettings.SIMULATOR_KEY_ROTATE_SPEED_TOOLTIP), VIUSettings.simulatorKeyRotateSpeed);
                            VIUSettings.simulatorMouseRotateSpeed = EditorGUILayout.DelayedFloatField(new GUIContent("Mouse Rotate Speed"), VIUSettings.simulatorMouseRotateSpeed);
                            EditorGUI.indentLevel--;
                        }
                        if (!VIUSettings.enableSimulatorKeyboardMouseControl && support)
                        {
                            GUI.enabled = true;
                        }

                        EditorGUI.indentLevel -= 2;
                    }
                    if (support)
                    {
                        s_guiChanged |= EditorGUI.EndChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = true;
                    }
                }
            }
Example #2
0
            public override void OnPreferenceGUI()
            {
                const string title = "Windows MR";

                if (canSupport)
                {
                    var wasSupported = support;
                    support          = m_foldouter.ShowFoldoutButtonOnToggleEnabled(new GUIContent(title, "Windows MR"), wasSupported);
                    s_symbolChanged |= wasSupported != support;
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    Foldouter.ShowFoldoutBlank();

                    if (activeBuildTargetGroup != BuildTargetGroup.Standalone)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
                    }
#if UNITY_2020_2_OR_NEWER && FALSE // openxr not fully supported yet
                    else if (!PackageManagerHelper.IsPackageInList(OPENXR_PLUGIN_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenXR Plugin package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("OpenXR Plugin", OPENXR_PLUGIN_PACKAGE_NAME);
                    }
#elif UNITY_2019_3_OR_NEWER
                    else if (!PackageManagerHelper.IsPackageInList(WINDOWSMR_XR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Windows XR Plugin package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("Windows XR Plugin", WINDOWSMR_XR_PACKAGE_NAME);
                    }
#elif UNITY_2018_2_OR_NEWER
                    else if (!PackageManagerHelper.IsPackageInList(WINDOWSMR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Windows Mixed Reality package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("Windows Mixed Reality", WINDOWSMR_PACKAGE_NAME);
                    }
#endif

                    GUILayout.EndHorizontal();
                }
            }
            public override void OnPreferenceGUI()
            {
                const string title = "VIVE <size=9>(OpenVR compatible device)</size>";

                if (canSupport)
                {
                    support = m_foldouter.ShowFoldoutButtonOnToggleEnabled(new GUIContent(title), support);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    Foldouter.ShowFoldoutBlank();

                    if (activeBuildTargetGroup != BuildTargetGroup.Standalone)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
                    }
                    else if (!VRModule.isSteamVRPluginDetected)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "SteamVR Plugin required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowUrlLinkButton(URL_STEAM_VR_PLUGIN);
                    }

                    GUILayout.EndHorizontal();
                }

                if (support && m_foldouter.isExpended)
                {
                    if (support && VRModule.isSteamVRPluginDetected)
                    {
                        EditorGUI.BeginChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = false;
                    }
                    {
                        EditorGUI.indentLevel += 2;

                        VIUSettings.autoLoadExternalCameraConfigOnStart = EditorGUILayout.ToggleLeft(new GUIContent("Load Config and Enable External Camera on Start", "You can also load config by calling ExternalCameraHook.LoadConfigFromFile(path) in script."), VIUSettings.autoLoadExternalCameraConfigOnStart);
                        if (!VIUSettings.autoLoadExternalCameraConfigOnStart && support)
                        {
                            GUI.enabled = false;
                        }
                        {
                            EditorGUI.indentLevel++;

                            EditorGUI.BeginChangeCheck();
                            VIUSettings.externalCameraConfigFilePath = EditorGUILayout.DelayedTextField(new GUIContent("Config Path"), VIUSettings.externalCameraConfigFilePath);
                            if (string.IsNullOrEmpty(VIUSettings.externalCameraConfigFilePath))
                            {
                                VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                                EditorGUI.EndChangeCheck();
                            }
                            else if (EditorGUI.EndChangeCheck() && VIUSettings.externalCameraConfigFilePath.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
                            {
                                VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                            }
                            // Create button that writes default config file
                            if (VIUSettings.autoLoadExternalCameraConfigOnStart && support && !File.Exists(VIUSettings.externalCameraConfigFilePath))
                            {
                                if (support && VRModule.isSteamVRPluginDetected)
                                {
                                    s_guiChanged |= EditorGUI.EndChangeCheck();
                                }
                                ShowCreateExCamCfgButton();
                                if (support && VRModule.isSteamVRPluginDetected)
                                {
                                    EditorGUI.BeginChangeCheck();
                                }
                            }

                            EditorGUI.indentLevel--;
                        }
                        if (!VIUSettings.autoLoadExternalCameraConfigOnStart && support)
                        {
                            GUI.enabled = true;
                        }

                        VIUSettings.enableExternalCameraSwitch = EditorGUILayout.ToggleLeft(new GUIContent("Enable External Camera Switch", VIUSettings.EX_CAM_UI_SWITCH_TOOLTIP), VIUSettings.enableExternalCameraSwitch);
                        if (!VIUSettings.enableExternalCameraSwitch && support)
                        {
                            GUI.enabled = false;
                        }
                        {
                            EditorGUI.indentLevel++;

                            VIUSettings.externalCameraSwitchKey         = (KeyCode)EditorGUILayout.EnumPopup("Switch Key", VIUSettings.externalCameraSwitchKey);
                            VIUSettings.externalCameraSwitchKeyModifier = (KeyCode)EditorGUILayout.EnumPopup("Switch Key Modifier", VIUSettings.externalCameraSwitchKeyModifier);

                            EditorGUI.indentLevel--;
                        }
                        if (!VIUSettings.enableExternalCameraSwitch && support)
                        {
                            GUI.enabled = true;
                        }

                        EditorGUI.indentLevel -= 2;
                    }
                    if (support && VRModule.isSteamVRPluginDetected)
                    {
                        s_guiChanged |= EditorGUI.EndChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = true;
                    }
                }

                if (support && !VRModule.isSteamVRPluginDetected)
                {
                    EditorGUI.indentLevel += 2;

                    GUILayout.BeginHorizontal();
                    EditorGUILayout.HelpBox("External-Camera(Mix-Reality), animated controller model, VIVE Controller haptics(vibration)" +
#if UNITY_2017_1_OR_NEWER
                                            ", VIVE Tracker USB/Pogo-pin input" +
#else
                                            ", VIVE Tracker device" +
#endif
                                            " NOT supported! Install SteamVR Plugin to get support.", MessageType.Warning);

                    s_warningHeight = Mathf.Max(s_warningHeight, GUILayoutUtility.GetLastRect().height);

                    if (!VRModule.isSteamVRPluginDetected)
                    {
                        GUILayout.BeginVertical(GUILayout.Height(s_warningHeight));
                        GUILayout.FlexibleSpace();
                        ShowUrlLinkButton(URL_STEAM_VR_PLUGIN);
                        GUILayout.FlexibleSpace();
                        GUILayout.EndVertical();
                    }
                    GUILayout.EndHorizontal();

                    EditorGUI.indentLevel -= 2;
                }
            }
Example #4
0
            public override void OnPreferenceGUI()
            {
                const string title = "OpenVR";

                if (canSupport)
                {
                    support = m_foldouter.ShowFoldoutButtonOnToggleEnabled(new GUIContent(title, "VIVE, VIVE Pro, VIVE Pro Eye, VIVE Cosmos\nOculus Rift, Oculus Rift S, Windows MR"), support);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    Foldouter.ShowFoldoutBlank();

                    if (activeBuildTargetGroup != BuildTargetGroup.Standalone)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
                    }
#if UNITY_2019_3_OR_NEWER
                    else if (!PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenVR XR Plugin package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();

                        bool hasValveRegistryAdded = RegistryToolSettings.IsRegistryExists(ValveRegistry);
                        if (hasValveRegistryAdded)
                        {
                            ShowAddPackageButton("OpenVR XR Plugin", OPENVR_XR_PACKAGE_NAME);
                        }
                        else
                        {
                            if (GUILayout.Button(new GUIContent("Add Valve Registry")))
                            {
                                bool result = EditorUtility.DisplayDialog(
                                    "Add Valve Registry",
                                    "Do you want to add Valve registry to your project?\n\nBy adding the Valve registry (" + ValveRegistry.url + ") in your 'Packages/manifest.json', VIU can install OpenVR XR Plugin for you.\n\nIn addition, you can discover, install, update or remove the packages from Valve in the package manager window later.",
                                    "Add",
                                    "Cancel");

                                if (result)
                                {
                                    RegistryToolSettings.AddRegistry(ValveRegistry);
                                }
                            }
                        }
                    }
#endif
#if !UNITY_2020_1_OR_NEWER
                    else if (!PackageManagerHelper.IsPackageInList(OPENVR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenVR (Desktop) package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("OpenVR (Desktop)", OPENVR_PACKAGE_NAME);
                    }
#endif
                    else if (!VRModule.isSteamVRPluginDetected)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "SteamVR Plugin required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowUrlLinkButton(URL_STEAM_VR_PLUGIN);
                    }

                    GUILayout.EndHorizontal();
                }

                if (support && m_foldouter.isExpended)
                {
                    if (support && VRModule.isSteamVRPluginDetected)
                    {
                        EditorGUI.BeginChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = false;
                    }
                    {
                        EditorGUI.indentLevel += 2;

                        VIUSettings.autoLoadExternalCameraConfigOnStart = EditorGUILayout.ToggleLeft(new GUIContent("Load Config and Enable External Camera on Start", "You can also load config by calling ExternalCameraHook.LoadConfigFromFile(path) in script."), VIUSettings.autoLoadExternalCameraConfigOnStart);
                        if (!VIUSettings.autoLoadExternalCameraConfigOnStart && support)
                        {
                            GUI.enabled = false;
                        }
                        {
                            EditorGUI.indentLevel++;

                            EditorGUI.BeginChangeCheck();
                            VIUSettings.externalCameraConfigFilePath = EditorGUILayout.DelayedTextField(new GUIContent("Config Path"), VIUSettings.externalCameraConfigFilePath);
                            if (string.IsNullOrEmpty(VIUSettings.externalCameraConfigFilePath))
                            {
                                VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                                EditorGUI.EndChangeCheck();
                            }
                            else if (EditorGUI.EndChangeCheck() && VIUSettings.externalCameraConfigFilePath.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
                            {
                                VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                            }
                            // Create button that writes default config file
                            if (VIUSettings.autoLoadExternalCameraConfigOnStart && support && !File.Exists(VIUSettings.externalCameraConfigFilePath))
                            {
                                if (support && VRModule.isSteamVRPluginDetected)
                                {
                                    s_guiChanged |= EditorGUI.EndChangeCheck();
                                }
                                ShowCreateExCamCfgButton();
                                if (support && VRModule.isSteamVRPluginDetected)
                                {
                                    EditorGUI.BeginChangeCheck();
                                }
                            }

                            EditorGUI.indentLevel--;
                        }
                        if (!VIUSettings.autoLoadExternalCameraConfigOnStart && support)
                        {
                            GUI.enabled = true;
                        }

                        VIUSettings.enableExternalCameraSwitch = EditorGUILayout.ToggleLeft(new GUIContent("Enable External Camera Switch", VIUSettings.EX_CAM_UI_SWITCH_TOOLTIP), VIUSettings.enableExternalCameraSwitch);
                        if (!VIUSettings.enableExternalCameraSwitch && support)
                        {
                            GUI.enabled = false;
                        }
                        {
                            EditorGUI.indentLevel++;

                            VIUSettings.externalCameraSwitchKey         = (KeyCode)EditorGUILayout.EnumPopup("Switch Key", VIUSettings.externalCameraSwitchKey);
                            VIUSettings.externalCameraSwitchKeyModifier = (KeyCode)EditorGUILayout.EnumPopup("Switch Key Modifier", VIUSettings.externalCameraSwitchKeyModifier);

                            EditorGUI.indentLevel--;
                        }
                        if (!VIUSettings.enableExternalCameraSwitch && support)
                        {
                            GUI.enabled = true;
                        }

                        EditorGUI.indentLevel -= 2;
                    }
                    if (support && VRModule.isSteamVRPluginDetected)
                    {
                        s_guiChanged |= EditorGUI.EndChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = true;
                    }
                }

                if (support && !VRModule.isSteamVRPluginDetected)
                {
                    EditorGUI.indentLevel += 2;

#if VIU_XR_GENERAL_SETTINGS
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.HelpBox("For now, to get access to controllers and other forms of input, you will need to install the beta version of the SteamVR Unity Plugin.", MessageType.Warning);

                    s_warningHeight = Mathf.Max(s_warningHeight, GUILayoutUtility.GetLastRect().height);

                    GUILayout.BeginVertical(GUILayout.Height(s_warningHeight));
                    GUILayout.FlexibleSpace();
                    ShowUrlLinkButton(URL_STEAM_VR_PLUGIN_BETA, "Get SteamVR Plugin (beta)");
                    GUILayout.FlexibleSpace();
                    GUILayout.EndVertical();

                    GUILayout.EndHorizontal();
#else
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.HelpBox("External-Camera(Mix-Reality), animated controller model" +
                                            ", VIVE Controller haptics(vibration)" +
#if UNITY_2017_1_OR_NEWER
                                            ", VIVE Tracker USB/Pogo-pin input" +
#else
                                            ", VIVE Tracker device" +
#endif
                                            " NOT supported! " +
#if VIU_PACKAGE
                                            "Install SteamVR Plugin 2.4.0 or newer to get support."
#else
                                            "Install SteamVR Plugin to get support."
#endif
                                            , MessageType.Warning);

                    s_warningHeight = Mathf.Max(s_warningHeight, GUILayoutUtility.GetLastRect().height);

                    GUILayout.BeginVertical(GUILayout.Height(s_warningHeight));
                    GUILayout.FlexibleSpace();
                    ShowUrlLinkButton(URL_STEAM_VR_PLUGIN, "Get SteamVR Plugin");
                    GUILayout.FlexibleSpace();
                    GUILayout.EndVertical();

                    GUILayout.EndHorizontal();
#endif
                    EditorGUI.indentLevel -= 2;
                }
            }
            public override void OnPreferenceGUI()
            {
                const string title = "OpenVR";

                if (canSupport)
                {
                    var wasSupported = support;
                    support          = m_foldouter.ShowFoldoutButtonOnToggleEnabled(new GUIContent(title, "VIVE, VIVE Pro, VIVE Pro Eye, VIVE Cosmos\nOculus Rift, Oculus Rift S, Windows MR"), wasSupported);
                    s_symbolChanged |= wasSupported != support;
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    Foldouter.ShowFoldoutBlank();

                    if (activeBuildTargetGroup != BuildTargetGroup.Standalone)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
                    }
#if UNITY_2020_2_OR_NEWER && FALSE // openxr not fully supported yet
                    else if (!PackageManagerHelper.IsPackageInList(OPENXR_PLUGIN_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenXR Plugin ackage required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("OpenXR Plugin", OPENXR_PLUGIN_PACKAGE_NAME);
                    }
#elif UNITY_2019_3_OR_NEWER && FALSE // openvr xr plugin on Valve registry is obsolete
                    else if (!PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenVR XR Plugin package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();

                        if (GUILayout.Button(new GUIContent("Add OpenVR XR Plugin Package", "Add " + OPENVR_XR_PACKAGE_NAME + " to Package Manager"), GUILayout.ExpandWidth(false)))
                        {
                            if (!ManifestUtils.CheckRegistryExists(ValveRegistry))
                            {
                                ManifestUtils.AddRegistry(ValveRegistry);
                            }

                            PackageManagerHelper.AddToPackageList(OPENVR_XR_PACKAGE_NAME);
                            VIUProjectSettings.Instance.isInstallingOpenVRXRPlugin = true;
                        }
                    }
#elif UNITY_2018_2_OR_NEWER && FALSE // obsolete
                    else if (!PackageManagerHelper.IsPackageInList(OPENVR_PACKAGE_NAME))
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "OpenVR (Desktop) package required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowAddPackageButton("OpenVR (Desktop)", OPENVR_PACKAGE_NAME);
                    }
#endif
                    else if (!VRModule.isSteamVRPluginDetected)
                    {
                        GUI.enabled = false;
                        ShowToggle(new GUIContent(title, "SteamVR Plugin required."), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowUrlLinkButton(URL_STEAM_VR_PLUGIN);
                    }

                    GUILayout.EndHorizontal();
                }

                if (support && m_foldouter.isExpended)
                {
                    EditorGUI.indentLevel += 2;

                    // Vive Hand Tracking Submodule
                    const string vhtSdkUrl = "https://developer.vive.com/resources/vive-sense/sdk/vive-hand-tracking-sdk/";
                    const string vhtTitle  = "Enable Vive Hand Tracking";
                    if (!VRModule.isViveHandTrackingDetected)
                    {
                        GUILayout.BeginHorizontal();
                        GUI.enabled = false;
                        EditorGUILayout.ToggleLeft(new GUIContent(vhtTitle, "Vive Hand Tracking SDK required"), false, GUILayout.Width(230f));
                        GUI.enabled = true;
                        GUILayout.FlexibleSpace();
                        ShowUrlLinkButton(vhtSdkUrl);
                        GUILayout.EndHorizontal();
                    }
                    else
                    {
                        EditorGUI.BeginChangeCheck();
                        VRModuleSettings.activateViveHandTrackingSubmodule = EditorGUILayout.ToggleLeft(new GUIContent(vhtTitle, "Works on Vive, VIVE Pro, Vive Pro Eye, VIVE Cosmos, VIVE Cosmos XR and Valve Index"), VRModuleSettings.activateViveHandTrackingSubmodule);
                        s_guiChanged |= EditorGUI.EndChangeCheck();
                    }

                    if (VRModule.isSteamVRPluginDetected)
                    {
                        EditorGUI.BeginChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = false;
                    }

                    // Skeleton mode
                    VIUSettings.steamVRLeftSkeletonMode  = (SteamVRSkeletonMode)EditorGUILayout.EnumPopup(new GUIContent("Left Controller Skeleton", "This effects RenderModelHook's behaviour"), VIUSettings.steamVRLeftSkeletonMode);
                    VIUSettings.steamVRRightSkeletonMode = (SteamVRSkeletonMode)EditorGUILayout.EnumPopup(new GUIContent("Right Controller Skeleton", "This effects RenderModelHook's behaviour"), VIUSettings.steamVRRightSkeletonMode);

                    VIUSettings.autoLoadExternalCameraConfigOnStart = EditorGUILayout.ToggleLeft(new GUIContent("Load Config and Enable External Camera on Start", "You can also load config by calling ExternalCameraHook.LoadConfigFromFile(path) in script."), VIUSettings.autoLoadExternalCameraConfigOnStart);
                    if (!VIUSettings.autoLoadExternalCameraConfigOnStart)
                    {
                        GUI.enabled = false;
                    }
                    {
                        EditorGUI.indentLevel++;

                        EditorGUI.BeginChangeCheck();
                        VIUSettings.externalCameraConfigFilePath = EditorGUILayout.DelayedTextField(new GUIContent("Config Path"), VIUSettings.externalCameraConfigFilePath);
                        if (string.IsNullOrEmpty(VIUSettings.externalCameraConfigFilePath))
                        {
                            VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                            EditorGUI.EndChangeCheck();
                        }
                        else if (EditorGUI.EndChangeCheck() && VIUSettings.externalCameraConfigFilePath.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
                        {
                            VIUSettings.externalCameraConfigFilePath = VIUSettings.EXTERNAL_CAMERA_CONFIG_FILE_PATH_DEFAULT_VALUE;
                        }
                        // Create button that writes default config file
                        if (VIUSettings.autoLoadExternalCameraConfigOnStart && !File.Exists(VIUSettings.externalCameraConfigFilePath))
                        {
                            if (VRModule.isSteamVRPluginDetected)
                            {
                                s_guiChanged |= EditorGUI.EndChangeCheck();
                            }
                            ShowCreateExCamCfgButton();
                            if (VRModule.isSteamVRPluginDetected)
                            {
                                EditorGUI.BeginChangeCheck();
                            }
                        }

                        EditorGUI.indentLevel--;
                    }
                    if (!VIUSettings.autoLoadExternalCameraConfigOnStart)
                    {
                        GUI.enabled = true;
                    }

                    VIUSettings.enableExternalCameraSwitch = EditorGUILayout.ToggleLeft(new GUIContent("Enable External Camera Switch", VIUSettings.EX_CAM_UI_SWITCH_TOOLTIP), VIUSettings.enableExternalCameraSwitch);
                    if (!VIUSettings.enableExternalCameraSwitch)
                    {
                        GUI.enabled = false;
                    }
                    {
                        EditorGUI.indentLevel++;

                        VIUSettings.externalCameraSwitchKey         = (KeyCode)EditorGUILayout.EnumPopup("Switch Key", VIUSettings.externalCameraSwitchKey);
                        VIUSettings.externalCameraSwitchKeyModifier = (KeyCode)EditorGUILayout.EnumPopup("Switch Key Modifier", VIUSettings.externalCameraSwitchKeyModifier);

                        EditorGUI.indentLevel--;
                    }
                    if (!VIUSettings.enableExternalCameraSwitch)
                    {
                        GUI.enabled = true;
                    }

                    EditorGUI.indentLevel -= 2;

                    if (VRModule.isSteamVRPluginDetected)
                    {
                        s_guiChanged |= EditorGUI.EndChangeCheck();
                    }
                    else
                    {
                        GUI.enabled = true;
                    }
                }

                if (support && !VRModule.isSteamVRPluginDetected && !PackageManagerHelper.IsPackageInList(OPENXR_PLUGIN_PACKAGE_NAME))
                {
                    EditorGUI.indentLevel += 2;

                    GUILayout.BeginHorizontal();
                    EditorGUILayout.HelpBox(
#if VIU_XR_GENERAL_SETTINGS
                        "Input" +
#elif UNITY_2017_1_OR_NEWER
                        "External-Camera(Mix-Reality), animated controller model" +
                        ", VIVE Controller haptics(vibration)" +
                        ", VIVE Tracker USB/Pogo-pin input" +
#else
                        "External-Camera(Mix-Reality), animated controller model" +
                        ", VIVE Controller haptics(vibration)" +
                        ", VIVE Tracker device" +
#endif
                        " NOT supported! " +
                        "Install SteamVR Plugin to get support."
                        , MessageType.Warning);

                    s_warningHeight = Mathf.Max(s_warningHeight, GUILayoutUtility.GetLastRect().height);
                    GUILayout.FlexibleSpace();

                    GUILayout.BeginVertical(GUILayout.Height(s_warningHeight));
                    GUILayout.FlexibleSpace();
                    ShowUrlLinkButton(URL_STEAM_VR_PLUGIN, "Get SteamVR Plugin");
                    GUILayout.FlexibleSpace();
                    GUILayout.EndVertical();

                    GUILayout.EndHorizontal();

                    EditorGUI.indentLevel -= 2;
                }

#if UNITY_2019_3_OR_NEWER
                if (VIUProjectSettings.Instance.isInstallingOpenVRXRPlugin)
                {
                    bool isPackageInstalled = PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME) ||
                                              PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME_OLD);
                    bool isLoaderEnabled = XRPluginManagementUtils.IsXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_NAME, BuildTargetGroup.Standalone);
                    if (isPackageInstalled && !isLoaderEnabled)
                    {
                        XRPluginManagementUtils.SetXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_CLASS_NAME, BuildTargetGroup.Standalone, true);
                        OpenVRSDK.enabled = true;

                        VIUProjectSettings.Instance.isInstallingOpenVRXRPlugin = false;
                    }
                }
#endif
            }