Example #1
0
        public static void ShowWindowsMRControllerList(bool active, TBInput.ControlType control)
        {
            #if TB_WINDOWS_MR
            EditorGUILayout.BeginVertical();
            EditorGUI.BeginDisabledGroup(!active);
            switch (control)
            {
            case TBInput.ControlType.HandControllers:
                if (GUILayout.Button("WMR Motion Controller", TBEditorStyles.controllerSelectButton))
                {
                    TBEditorInputSettings.LoadController <TBWindowsMRInput.Button>(ref controllers, TBController_WindowsMR_MotionControllerLeft.instance.GetName(), TBController_WindowsMR_MotionControllerLeft.instance.GetDefaultDefs(), TBController_WindowsMR_MotionControllerLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <TBWindowsMRInput.Button>(ref controllers, TBController_WindowsMR_MotionControllerRight.instance.GetName(), TBController_WindowsMR_MotionControllerRight.instance.GetDefaultDefs(), TBController_WindowsMR_MotionControllerRight.instance.GetFileName());
                    WindowsMRMotionControllerConfigWindow.ShowWindow("Windows Mixed Reality Motion Controller");
                }
                break;

            case TBInput.ControlType.Mobile3DOFController:
                break;

            case TBInput.ControlType.Gamepad:
                TBEditorInputSettings.GetControllerButton <TBXInput.TBXInputButton, XInputGamepadConfigWindow>(TBController_XInput_Gamepad.instance, ref TBEditorInputXInput.controllers, active);
                break;

            case TBInput.ControlType.ClickRemote:
                break;
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndVertical();
            #endif
        }
Example #2
0
        public static void ShowGoogleControllerList(bool active, TBInput.ControlType control)
        {
            #if TB_GOOGLE
            EditorGUILayout.BeginVertical();
            EditorGUI.BeginDisabledGroup(!active);
            switch (control)
            {
            case TBInput.ControlType.HandControllers:
                if (GUILayout.Button("Daydream 6DOF Controller", TBEditorStyles.controllerSelectButton))
                {
                    TBEditorInputSettings.LoadController <GvrControllerButton>(ref controllers, TBController_Google_Daydream6DOFLeft.instance.GetName(), TBController_Google_Daydream6DOFLeft.instance.GetDefaultDefs(), TBController_Google_Daydream6DOFLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <GvrControllerButton>(ref controllers, TBController_Google_Daydream6DOFRight.instance.GetName(), TBController_Google_Daydream6DOFRight.instance.GetDefaultDefs(), TBController_Google_Daydream6DOFRight.instance.GetFileName());
                    GoogleDaydream6DOFControllerConfigWindow.ShowWindow("Daydream 6DOF Controller (Experimental)");
                }
                break;

            case TBInput.ControlType.Mobile3DOFController:
                TBEditorInputSettings.GetControllerButton <GvrControllerButton, GoogleDaydreamControllerConfigWindow>(TBController_Google_Daydream.instance, ref controllers, active);
                break;

            case TBInput.ControlType.Gamepad:
                break;

            case TBInput.ControlType.ClickRemote:
                break;
            }
            #endif
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndVertical();
        }
Example #3
0
        /// <summary>
        /// Displays the column of controllers for the Oculus SDK in TBEditorInputSettings.
        /// </summary>
        /// <param name="active"></param>
        /// <param name="control"></param>
        public static void ShowOculusControllerList(bool active, TBInput.ControlType control)
        {
#if TB_OCULUS
            EditorGUILayout.BeginVertical();
            EditorGUI.BeginDisabledGroup(!active);

            // For each controller, we need to load the button defs before the window is opened.
            switch (control)
            {
            case TBInput.ControlType.HandControllers:
                if (GUILayout.Button("Oculus Touch", TBEditorStyles.controllerSelectButton))
                {
                    // Oculus Touch has two controllers (left and right) with different buttons, but we show them simulaneously, so we are overriding the normal behavior for buttons.
                    TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_TouchLeft.instance.GetName(), TBController_Oculus_TouchLeft.instance.GetDefaultDefs(), TBController_Oculus_TouchLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_TouchRight.instance.GetName(), TBController_Oculus_TouchRight.instance.GetDefaultDefs(), TBController_Oculus_TouchRight.instance.GetFileName());
                    OculusTouchConfigWindow.ShowWindow("Oculus Touch");
                }
                if (GUILayout.Button("Oculus Quest", TBEditorStyles.controllerSelectButton))
                {
                    // Oculus Quest / Santa Cruz has a prototype controller with a touchpad that differs from the final controller design.
                    TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_QuestLeft.instance.GetName(), TBController_Oculus_QuestLeft.instance.GetDefaultDefs(), TBController_Oculus_QuestLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_QuestRight.instance.GetName(), TBController_Oculus_QuestRight.instance.GetDefaultDefs(), TBController_Oculus_QuestRight.instance.GetFileName());
                    OculusQuestConfigWindow.ShowWindow("Oculus Quest");
                }
                EditorGUI.BeginDisabledGroup(!Settings.TBOculusSettings.LoadOculusSettings(Settings.TBOculusSettings.OculusDeviceFamily.Rift).allowViveEmulation);
                {
                    if (GUILayout.Button("Vive Controller", TBEditorStyles.controllerSelectButton))
                    {
                        // Oculus Touch has two controllers (left and right) with different buttons, but we show them simulaneously, so we are overriding the normal behavior for buttons.
                        TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_ViveControllerLeft.instance.GetName(), TBController_Oculus_ViveControllerLeft.instance.GetDefaultDefs(), TBController_Oculus_ViveControllerLeft.instance.GetFileName());
                        TBEditorInputSettings.LoadController <OVRInput.RawButton>(ref controllers, TBController_Oculus_ViveControllerRight.instance.GetName(), TBController_Oculus_ViveControllerRight.instance.GetDefaultDefs(), TBController_Oculus_ViveControllerRight.instance.GetFileName());
                        OculusViveControllerConfigWindow.ShowWindow("Vive Controller");
                    }
                }
                EditorGUI.EndDisabledGroup();
                break;

            case TBInput.ControlType.Mobile3DOFController:
                TBEditorInputSettings.GetControllerButton <OVRInput.RawButton, OculusGearVRControllerConfigWindow>(TBController_Oculus_GearVRController.instance, ref controllers, active, "Oculus Go / Gear VR Controller");
                break;

            case TBInput.ControlType.Gamepad:
                TBEditorInputSettings.GetControllerButton <OVRInput.RawButton, OculusGamepadConfigWindow>(TBController_Oculus_Gamepad.instance, ref controllers, active);
                break;

            case TBInput.ControlType.ClickRemote:
                TBEditorInputSettings.GetControllerButton <OVRInput.RawButton, OculusGearVRTouchpadConfigWindow>(TBController_Oculus_GearVRTouchpad.instance, ref controllers, active);
                TBEditorInputSettings.GetControllerButton <OVRInput.RawButton, OculusRemoteConfigWindow>(TBController_Oculus_Remote.instance, ref controllers, active);
                break;
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndVertical();
#endif
        }
Example #4
0
        public static void ShowSteamVRControllerList(bool active, TBInput.ControlType control)
        {
            #if TB_STEAM_VR
            EditorGUILayout.BeginVertical();
            EditorGUI.BeginDisabledGroup(!active);
            switch (control)
            {
            case TBInput.ControlType.HandControllers:
                if (GUILayout.Button("Vive Controller", TBEditorStyles.controllerSelectButton))
                {
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_ViveControllerLeft.instance.GetName(), TBController_SteamVR_ViveControllerLeft.instance.GetDefaultDefs(), TBController_SteamVR_ViveControllerLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_ViveControllerRight.instance.GetName(), TBController_SteamVR_ViveControllerRight.instance.GetDefaultDefs(), TBController_SteamVR_ViveControllerRight.instance.GetFileName());
                    SteamVRViveConfigWindow.ShowWindow("Vive Controller");
                }

                if (GUILayout.Button("Oculus Touch", TBEditorStyles.controllerSelectButton))
                {
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_OculusTouchLeft.instance.GetName(), TBController_SteamVR_OculusTouchLeft.instance.GetDefaultDefs(), TBController_SteamVR_OculusTouchLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_OculusTouchRight.instance.GetName(), TBController_SteamVR_OculusTouchRight.instance.GetDefaultDefs(), TBController_SteamVR_OculusTouchRight.instance.GetFileName());
                    SteamVROculusTouchConfigWindow.ShowWindow("Oculus Touch");
                }

                if (GUILayout.Button("WMR Motion Controller", TBEditorStyles.controllerSelectButton))
                {
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_WindowsMixedRealityLeft.instance.GetName(), TBController_SteamVR_WindowsMixedRealityLeft.instance.GetDefaultDefs(), TBController_SteamVR_WindowsMixedRealityLeft.instance.GetFileName());
                    TBEditorInputSettings.LoadController <EVRButtonId>(ref controllers, TBController_SteamVR_WindowsMixedRealityRight.instance.GetName(), TBController_SteamVR_WindowsMixedRealityRight.instance.GetDefaultDefs(), TBController_SteamVR_WindowsMixedRealityRight.instance.GetFileName());
                    SteamVRWindowsMixedRealityConfigWindow.ShowWindow("Windows Mixed Reality Motion Controller");
                }
                break;

            case TBInput.ControlType.Mobile3DOFController:
                break;

            case TBInput.ControlType.Gamepad:
                TBEditorInputSettings.GetControllerButton <TBXInput.TBXInputButton, XInputGamepadConfigWindow>(TBController_XInput_Gamepad.instance, ref TBEditorInputXInput.controllers, active);
                break;

            case TBInput.ControlType.ClickRemote:
                break;
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndVertical();
            #endif
        }