public static void ShowBindingsForEditor()
        {
            bool temporarySession = InitializeTemporarySession(false);

            Valve.VR.EVRSettingsError bindingFlagError = Valve.VR.EVRSettingsError.None;
            Valve.VR.OpenVR.Settings.SetBool(Valve.VR.OpenVR.k_pch_SteamVR_Section,
                                             Valve.VR.OpenVR.k_pch_SteamVR_DebugInputBinding, true, ref bindingFlagError);

            if (bindingFlagError != Valve.VR.EVRSettingsError.None)
            {
                Debug.LogError("<b>[SteamVR]</b> Error turning on the debug input binding flag in steamvr: " +
                               bindingFlagError.ToString());
            }

            if (Application.isPlaying == false)
            {
                IdentifyEditorApplication();

                SteamVR_Input.IdentifyActionsFile();
            }

            if (temporarySession)
            {
                ExitTemporarySession();
            }

            string bindingurl = "http://localhost:8998/dashboard/controllerbinding.html?app=" +
                                SteamVR_Settings.instance.editorAppKey;

#if UNITY_STANDALONE_WIN
            SteamVR_Windows_Editor_Helper.BrowserApplication
                browser = SteamVR_Windows_Editor_Helper.GetDefaultBrowser();
            if (browser == SteamVR_Windows_Editor_Helper.BrowserApplication.Unknown)
            {
                Debug.LogError(
                    "<b>[SteamVR]</b> Unfortunately we were unable to detect your default browser. You may need to manually open the controller binding UI from SteamVR if it does not open successfully. SteamVR Menu -> Devices -> Controller Input Binding. Press play in your application to get it running then select it under Current Application.");
            }
            else if (browser == SteamVR_Windows_Editor_Helper.BrowserApplication.Edge)
            {
                Debug.LogError(
                    "<b>[SteamVR]</b> Microsoft Edge sometimes has issues with opening localhost webpages. You may need to manually open the controller binding UI from SteamVR if it did not load successfully. SteamVR Menu -> Devices -> Controller Input Binding. Press play in your application to get it running then select it under Current Application.");
            }
#endif
            Application.OpenURL(bindingurl); //todo: update with the actual api call
        }
Exemple #2
0
        public static void ShowBindingsForEditor()
        {
            bool temporarySession = InitializeTemporarySession(false);

            Valve.VR.EVRSettingsError bindingFlagError = Valve.VR.EVRSettingsError.None;
            Valve.VR.OpenVR.Settings.SetBool(Valve.VR.OpenVR.k_pch_SteamVR_Section, Valve.VR.OpenVR.k_pch_SteamVR_DebugInputBinding, true, ref bindingFlagError);

            if (bindingFlagError != Valve.VR.EVRSettingsError.None)
            {
                Debug.LogError("<b>[SteamVR]</b> Error turning on the debug input binding flag in steamvr: " + bindingFlagError.ToString());
            }

            if (Application.isPlaying == false)
            {
                IdentifyEditorApplication();

                SteamVR_Input.IdentifyActionsFile();
            }

            if (temporarySession)
            {
                ExitTemporarySession();
            }

            string bindingurl = "http://localhost:8998/dashboard/controllerbinding.html?app=" + SteamVR_Settings.instance.editorAppKey;

#if UNITY_STANDALONE_WIN
            SteamVR_Windows_Editor_Helper.BrowserApplication browser = SteamVR_Windows_Editor_Helper.GetDefaultBrowser();
            if (browser == SteamVR_Windows_Editor_Helper.BrowserApplication.Unknown || browser == SteamVR_Windows_Editor_Helper.BrowserApplication.Edge)
            {
                Debug.LogError("Unfortunately your browser " + browser.ToString() + " is not supported. Please manually open the controller binding UI from SteamVR. SteamVR Menu -> Devices -> Controller Input Binding. Press play in your application to get it running then select it under Current Application.");
            }
            else
            {
                Application.OpenURL(bindingurl); //todo: update with the actual call
            }
#else
            Application.OpenURL(bindingurl); //todo: update with the actual call
#endif
        }