123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using UnityEngine.InputSystem;
- using UnityEngine.InputSystem.Controls;
- using UnityEngine.InputSystem.Layouts;
- using UnityEngine.Scripting;
- namespace SC.XR.Unity.Simulation {
-
-
-
- [InputControlLayout(stateType = typeof(XRSimulatedControllerState), commonUsages = new[] { "LeftHand", "RightHand" }, isGenericTypeOfDevice = false, displayName = "XR Simulated Controller"), Preserve]
- public class XRSimulatedController : UnityEngine.InputSystem.XR.XRController
- {
-
-
-
- public Vector2Control primary2DAxis { get; private set; }
-
-
-
- public AxisControl trigger { get; private set; }
-
-
-
- public AxisControl grip { get; private set; }
-
-
-
- public Vector2Control secondary2DAxis { get; private set; }
-
-
-
- public ButtonControl primaryButton { get; private set; }
-
-
-
- public ButtonControl primaryTouch { get; private set; }
-
-
-
- public ButtonControl secondaryButton { get; private set; }
-
-
-
- public ButtonControl secondaryTouch { get; private set; }
-
-
-
- public ButtonControl gripButton { get; private set; }
-
-
-
- public ButtonControl triggerButton { get; private set; }
-
-
-
- public ButtonControl menuButton { get; private set; }
-
-
-
- public ButtonControl primary2DAxisClick { get; private set; }
-
-
-
- public ButtonControl primary2DAxisTouch { get; private set; }
-
-
-
- public ButtonControl secondary2DAxisClick { get; private set; }
-
-
-
- public ButtonControl secondary2DAxisTouch { get; private set; }
-
-
-
- public AxisControl batteryLevel { get; private set; }
-
-
-
- public ButtonControl userPresence { get; private set; }
-
-
-
- protected override void FinishSetup()
- {
- base.FinishSetup();
- primary2DAxis = GetChildControl<Vector2Control>(nameof(primary2DAxis));
- trigger = GetChildControl<AxisControl>(nameof(trigger));
- grip = GetChildControl<AxisControl>(nameof(grip));
- secondary2DAxis = GetChildControl<Vector2Control>(nameof(secondary2DAxis));
- primaryButton = GetChildControl<ButtonControl>(nameof(primaryButton));
- primaryTouch = GetChildControl<ButtonControl>(nameof(primaryTouch));
- secondaryButton = GetChildControl<ButtonControl>(nameof(secondaryButton));
- secondaryTouch = GetChildControl<ButtonControl>(nameof(secondaryTouch));
- gripButton = GetChildControl<ButtonControl>(nameof(gripButton));
- triggerButton = GetChildControl<ButtonControl>(nameof(triggerButton));
- menuButton = GetChildControl<ButtonControl>(nameof(menuButton));
- primary2DAxisClick = GetChildControl<ButtonControl>(nameof(primary2DAxisClick));
- primary2DAxisTouch = GetChildControl<ButtonControl>(nameof(primary2DAxisTouch));
- secondary2DAxisClick = GetChildControl<ButtonControl>(nameof(secondary2DAxisClick));
- secondary2DAxisTouch = GetChildControl<ButtonControl>(nameof(secondary2DAxisTouch));
- batteryLevel = GetChildControl<AxisControl>(nameof(batteryLevel));
- userPresence = GetChildControl<ButtonControl>(nameof(userPresence));
- }
- }
- }
|