Beispiel #1
0
 void OnGUI()
 {
     scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
     TBEditorInputSettings.ShowMaps <OVRInput.RawButton>(ref TBEditorInputOculus.controllers, TBController_Oculus_QuestLeft.instance.GetDefaultDefs(), TBController_Oculus_QuestLeft.instance.GetName(), TBEditorStyles.sectionOverlayOculus, TBEditorStyles.solidOculus);
     TBEditorInputSettings.ShowMaps <OVRInput.RawButton>(ref TBEditorInputOculus.controllers, TBController_Oculus_QuestRight.instance.GetDefaultDefs(), TBController_Oculus_QuestRight.instance.GetName(), TBEditorStyles.sectionOverlayOculus, TBEditorStyles.solidOculus);
     EditorGUILayout.EndScrollView();
 }
Beispiel #2
0
 void OnGUI()
 {
     scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
     TBEditorInputSettings.ShowMaps <GvrControllerButton>(ref TBEditorInputGoogle.controllers, TBController_Google_Daydream6DOFLeft.instance.GetDefaultDefs(), TBController_Google_Daydream6DOFLeft.instance.GetName(), TBEditorStyles.sectionOverlayGoogle, TBEditorStyles.solidGoogle);
     TBEditorInputSettings.ShowMaps <GvrControllerButton>(ref TBEditorInputGoogle.controllers, TBController_Google_Daydream6DOFRight.instance.GetDefaultDefs(), TBController_Google_Daydream6DOFRight.instance.GetName(), TBEditorStyles.sectionOverlayGoogle, TBEditorStyles.solidGoogle);
     EditorGUILayout.EndScrollView();
 }
Beispiel #3
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();
        }
Beispiel #4
0
 void OnGUI()
 {
     scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
     TBEditorInputSettings.ShowMaps <TBWindowsMRInput.Button>(ref TBEditorInputWindowsMR.controllers, TBController_WindowsMR_MotionControllerLeft.instance.GetDefaultDefs(), TBController_WindowsMR_MotionControllerLeft.instance.GetName(), TBEditorStyles.sectionOverlayWindows, TBEditorStyles.solidWindows);
     TBEditorInputSettings.ShowMaps <TBWindowsMRInput.Button>(ref TBEditorInputWindowsMR.controllers, TBController_WindowsMR_MotionControllerRight.instance.GetDefaultDefs(), TBController_WindowsMR_MotionControllerRight.instance.GetName(), TBEditorStyles.sectionOverlayWindows, TBEditorStyles.solidWindows);
     EditorGUILayout.EndScrollView();
 }
Beispiel #5
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
        }
Beispiel #6
0
 void OnGUI()
 {
     scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
     TBEditorInputSettings.ShowMaps <EVRButtonId>(ref TBEditorInputSteamVR.controllers, TBController_SteamVR_WindowsMixedRealityLeft.instance.GetDefaultDefs(), TBController_SteamVR_WindowsMixedRealityLeft.instance.GetName(), TBEditorStyles.sectionOverlaySteam, TBEditorStyles.solidSteam);
     TBEditorInputSettings.ShowMaps <EVRButtonId>(ref TBEditorInputSteamVR.controllers, TBController_SteamVR_WindowsMixedRealityRight.instance.GetDefaultDefs(), TBController_SteamVR_WindowsMixedRealityRight.instance.GetName(), TBEditorStyles.sectionOverlaySteam, TBEditorStyles.solidSteam);
     EditorGUILayout.EndScrollView();
 }
Beispiel #7
0
 void OnGUI()
 {
     scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
     EditorGUILayout.HelpBox("Vive Controller support through Oculus Utiltiies is only used as a fallback if Steam VR plugin is not enabled. Note that you must disable this feature before making a build for Oculus Store, since Open VR DLLs are not permitted in builds for Oculus.", MessageType.Info);
     TBEditorInputSettings.ShowMaps <OVRInput.RawButton>(ref TBEditorInputOculus.controllers, TBController_Oculus_ViveControllerLeft.instance.GetDefaultDefs(), TBController_Oculus_ViveControllerLeft.instance.GetName(), TBEditorStyles.sectionOverlayOculus, TBEditorStyles.solidOculus);
     TBEditorInputSettings.ShowMaps <OVRInput.RawButton>(ref TBEditorInputOculus.controllers, TBController_Oculus_ViveControllerRight.instance.GetDefaultDefs(), TBController_Oculus_ViveControllerRight.instance.GetName(), TBEditorStyles.sectionOverlayOculus, TBEditorStyles.solidOculus);
     EditorGUILayout.EndScrollView();
 }
Beispiel #8
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
        }
Beispiel #9
0
 /// <summary>
 /// Displays button maps for a given controller.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="controllers"></param>
 /// <param name="defaultMaps"></param>
 /// <param name="controllerName"></param>
 public static void ShowMaps <T>(ref Dictionary <string, ButtonMapGroup <TBInput.ButtonDef <T> > > controllers, List <TBInput.ButtonDef <T> > defaultMaps, string controllerName, GUIStyle SDKBackground, Color buttonColor)
 {
     EditorGUILayout.BeginVertical(SDKBackground, new GUILayoutOption[] { GUILayout.ExpandHeight(true) });
     GUI.backgroundColor = buttonColor;
     EditorGUILayout.LabelField(controllerName, TBEditorStyles.h1);
     EditorGUILayout.Separator();
     TBEditorInputSettings.StartButtonMapTable();
     for (int i = 0; i < controllers[controllerName].defs.Count; i++)
     {
         TBEditorInputSettings.ShowButtonRows(ref controllers[controllerName].defs[i].virtualButtons, controllers[controllerName].defs[i].name, i, defaultMaps[i].virtualButtons, defaultMaps[i].supportsTouch, defaultMaps[i].supportsAxis1D, defaultMaps[i].supportsAxis2D);
     }
     TBEditorInputSettings.EndButtonMapTable();
     GUI.backgroundColor = Color.white;
     EditorGUILayout.EndVertical();
 }
Beispiel #10
0
        public static void GetControllerButton <T, W>(TBControllerBase <T> controller, ref Dictionary <string, ButtonMapGroup <TBInput.ButtonDef <T> > > controllers, bool active, string overrideName = "")
        {
            if (string.IsNullOrEmpty(overrideName))
            {
                overrideName = controller.GetName();
            }

            if (GUILayout.Button(overrideName, TBEditorStyles.controllerSelectButton))
            {
                if (active)
                {
                    TBEditorInputSettings.LoadController <T>(ref controllers, controller.GetName(), controller.GetDefaultDefs(), controller.GetFileName());
                    TBButtonMapWindow <W> .ShowWindow(controller.GetName());
                }
            }
        }
Beispiel #11
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
        }
Beispiel #12
0
 void OnGUI()
 {
     TBEditorInputSettings.ShowMaps <OVRInput.RawButton>(ref TBEditorInputOculus.controllers, TBController_Oculus_GearVRTouchpad.instance.GetDefaultDefs(), TBController_Oculus_GearVRTouchpad.instance.GetName(), TBEditorStyles.sectionOverlayOculus, TBEditorStyles.solidOculus);
 }
Beispiel #13
0
 void OnGUI()
 {
     TBEditorInputSettings.ShowMaps <GvrControllerButton>(ref TBEditorInputGoogle.controllers, TBController_Google_Daydream.instance.GetDefaultDefs(), TBController_Google_Daydream.instance.GetName(), TBEditorStyles.sectionOverlayGoogle, TBEditorStyles.solidGoogle);
 }
Beispiel #14
0
 void OnGUI()
 {
     TBEditorInputSettings.ShowMaps <TBXInput.TBXInputButton>(ref TBEditorInputXInput.controllers, TBController_XInput_Gamepad.instance.GetDefaultDefs(), TBController_XInput_Gamepad.instance.GetName(), TBEditorStyles.sectionOverlaySteam, TBEditorStyles.solidSteam);
 }