Maze / Library /PackageCache /com.unity.inputsystem@1.6.1 /InputSystem /Plugins /XR /Devices /WindowsMR.cs
| // ENABLE_VR is not defined on Game Core but the assembly is available with limited features when the XR module is enabled. | |
| // Docs generation is skipped because these are intended to be replaced with the com.unity.xr.windowsmr package. | |
| using UnityEngine.InputSystem.Controls; | |
| using UnityEngine.InputSystem.Layouts; | |
| using UnityEngine.InputSystem.XR; | |
| namespace UnityEngine.XR.WindowsMR.Input | |
| { | |
| /// <summary> | |
| /// A Windows Mixed Reality XR headset. | |
| /// </summary> | |
| [] | |
| public class WMRHMD : XRHMD | |
| { | |
| [] | |
| [] { "HeadPosition" })] | |
| [] { "HeadRotation" })] | |
| public ButtonControl userPresence { get; private set; } | |
| protected override void FinishSetup() | |
| { | |
| base.FinishSetup(); | |
| userPresence = GetChildControl<ButtonControl>("userPresence"); | |
| } | |
| } | |
| /// <summary> | |
| /// A Windows Mixed Reality XR controller. | |
| /// </summary> | |
| [] { "LeftHand", "RightHand" }, hideInUI = true)] | |
| public class HololensHand : XRController | |
| { | |
| [] { "gripVelocity" })] | |
| public Vector3Control deviceVelocity { get; private set; } | |
| [] { "triggerbutton" })] | |
| public ButtonControl airTap { get; private set; } | |
| [] | |
| public AxisControl sourceLossRisk { get; private set; } | |
| [] | |
| public Vector3Control sourceLossMitigationDirection { get; private set; } | |
| protected override void FinishSetup() | |
| { | |
| base.FinishSetup(); | |
| airTap = GetChildControl<ButtonControl>("airTap"); | |
| deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity"); | |
| sourceLossRisk = GetChildControl<AxisControl>("sourceLossRisk"); | |
| sourceLossMitigationDirection = GetChildControl<Vector3Control>("sourceLossMitigationDirection"); | |
| } | |
| } | |
| [] { "LeftHand", "RightHand" }, hideInUI = true)] | |
| public class WMRSpatialController : XRControllerWithRumble | |
| { | |
| [] { "Primary2DAxis", "thumbstickaxes" })] | |
| public Vector2Control joystick { get; private set; } | |
| [] { "Secondary2DAxis", "touchpadaxes" })] | |
| public Vector2Control touchpad { get; private set; } | |
| [] { "gripaxis" })] | |
| public AxisControl grip { get; private set; } | |
| [] { "gripbutton" })] | |
| public ButtonControl gripPressed { get; private set; } | |
| [] { "Primary", "menubutton" })] | |
| public ButtonControl menu { get; private set; } | |
| [] { "triggeraxis" })] | |
| public AxisControl trigger { get; private set; } | |
| [] { "triggerbutton" })] | |
| public ButtonControl triggerPressed { get; private set; } | |
| [] { "thumbstickpressed" })] | |
| public ButtonControl joystickClicked { get; private set; } | |
| [] { "joystickorpadpressed", "touchpadpressed" })] | |
| public ButtonControl touchpadClicked { get; private set; } | |
| [] { "joystickorpadtouched", "touchpadtouched" })] | |
| public ButtonControl touchpadTouched { get; private set; } | |
| [] { "gripVelocity" })] | |
| public Vector3Control deviceVelocity { get; private set; } | |
| [] { "gripAngularVelocity" })] | |
| public Vector3Control deviceAngularVelocity { get; private set; } | |
| [] | |
| public AxisControl batteryLevel { get; private set; } | |
| [] | |
| public AxisControl sourceLossRisk { get; private set; } | |
| [] | |
| public Vector3Control sourceLossMitigationDirection { get; private set; } | |
| [] | |
| public Vector3Control pointerPosition { get; private set; } | |
| [] { "PointerOrientation" })] | |
| public QuaternionControl pointerRotation { get; private set; } | |
| protected override void FinishSetup() | |
| { | |
| base.FinishSetup(); | |
| joystick = GetChildControl<Vector2Control>("joystick"); | |
| trigger = GetChildControl<AxisControl>("trigger"); | |
| touchpad = GetChildControl<Vector2Control>("touchpad"); | |
| grip = GetChildControl<AxisControl>("grip"); | |
| gripPressed = GetChildControl<ButtonControl>("gripPressed"); | |
| menu = GetChildControl<ButtonControl>("menu"); | |
| joystickClicked = GetChildControl<ButtonControl>("joystickClicked"); | |
| triggerPressed = GetChildControl<ButtonControl>("triggerPressed"); | |
| touchpadClicked = GetChildControl<ButtonControl>("touchpadClicked"); | |
| touchpadTouched = GetChildControl<ButtonControl>("touchPadTouched"); | |
| deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity"); | |
| deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity"); | |
| batteryLevel = GetChildControl<AxisControl>("batteryLevel"); | |
| sourceLossRisk = GetChildControl<AxisControl>("sourceLossRisk"); | |
| sourceLossMitigationDirection = GetChildControl<Vector3Control>("sourceLossMitigationDirection"); | |
| pointerPosition = GetChildControl<Vector3Control>("pointerPosition"); | |
| pointerRotation = GetChildControl<QuaternionControl>("pointerRotation"); | |
| } | |
| } | |
| } | |