Exemple #1
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();
            }

            OpenVR.Input.OpenBindingUI(SteamVR_Settings.instance.editorAppKey, 0, 0, true);

            if (temporarySession)
            {
                ExitTemporarySession();
            }
        }
Exemple #2
0
        public static void ShowBindingsForEditor()
        {
            var initOpenVR = (!SteamVR.active && !SteamVR.usingNativeSupport);

            if (initOpenVR)
            {
                var error = EVRInitError.None;
                OpenVR.Init(ref error, EVRApplicationType.VRApplication_Utility);

                if (error != EVRInitError.None)
                {
                    Debug.LogError("[SteamVR] Error during OpenVR Init: " + error.ToString());
                }
            }

            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("[SteamVR] Error turning on the debug input binding flag in steamvr: " + bindingFlagError.ToString());
            }

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

                SteamVR_Input.IdentifyActionsFile();
            }

            /*
             * GameObject tempObject = new GameObject("[Temp] [SteamVR Input]");
             * SteamVR_Input.Initialize(tempObject);
             *
             * VRActiveActionSet_t[] sets = new VRActiveActionSet_t[SteamVR_Input.actionSets.Length];
             * for (int setIndex = 0; setIndex < SteamVR_Input.actionSets.Length; setIndex++)
             * {
             *  sets[setIndex].ulActionSet = SteamVR_Input.actionSets[setIndex].handle;
             * }
             *
             * EVRInputError showBindingsError = OpenVR.Input.ShowBindingsForActionSet(sets, (uint)(sets.Length * System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRActiveActionSet_t))), 0);
             *
             * if (showBindingsError != EVRInputError.None)
             * {
             *  Debug.LogError("Error showing bindings ui: " + showBindingsError.ToString());
             * }
             */

            if (initOpenVR)
            {
                OpenVR.Shutdown();
            }

            Application.OpenURL("http://localhost:8998/dashboard/controllerbinding.html?app=" + SteamVR_Settings.instance.appKey.ToLower()); //todo: update with the actual call
        }
        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 #4
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
        }