15using System.Collections;
16using System.Collections.Generic;
17using UnityEngine.InputSystem;
18using UnityEngine.InputSystem.Utilities;
20public partial class @IH_HapticsInput : IInputActionCollection2, IDisposable
22 public InputActionAsset asset {
get; }
23 public @IH_HapticsInput()
25 asset = InputActionAsset.FromJson(
@"{
26 ""name"": ""IH_HapticsInput"",
29 ""name"": ""HapticsXR"",
30 ""id"": ""cb5a2207-7e84-46e3-8f8d-38e5b312def6"",
35 ""id"": ""98e14162-25d0-4640-89ae-c88f70e3e340"",
36 ""expectedControlType"": ""Haptic"",
38 ""interactions"": """",
39 ""initialStateCheck"": true
44 ""id"": ""2f219f26-2872-45ef-9133-636d833ebcf6"",
45 ""expectedControlType"": ""Haptic"",
47 ""interactions"": """",
48 ""initialStateCheck"": true
54 ""id"": ""07120713-2f08-4c23-af73-308fb7393ccd"",
55 ""path"": ""<XRController>{LeftHand}/haptic"",
56 ""interactions"": """",
60 ""isComposite"": false,
61 ""isPartOfComposite"": false
65 ""id"": ""21259124-14f0-4518-8ef2-52289145b374"",
66 ""path"": ""<XRController>{RightHand}/haptic"",
67 ""interactions"": """",
70 ""action"": ""Right"",
71 ""isComposite"": false,
72 ""isPartOfComposite"": false
77 ""controlSchemes"": []
80 m_HapticsXR = asset.FindActionMap(
"HapticsXR", throwIfNotFound: true);
81 m_HapticsXR_Left = m_HapticsXR.FindAction(
"Left", throwIfNotFound: true);
82 m_HapticsXR_Right = m_HapticsXR.FindAction(
"Right", throwIfNotFound: true);
87 UnityEngine.Object.Destroy(asset);
90 public InputBinding? bindingMask
92 get => asset.bindingMask;
93 set => asset.bindingMask = value;
96 public ReadOnlyArray<InputDevice>? devices
99 set => asset.devices = value;
102 public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
104 public bool Contains(InputAction action)
106 return asset.Contains(action);
109 public IEnumerator<InputAction> GetEnumerator()
111 return asset.GetEnumerator();
114 IEnumerator IEnumerable.GetEnumerator()
116 return GetEnumerator();
124 public void Disable()
128 public IEnumerable<InputBinding> bindings => asset.bindings;
130 public InputAction FindAction(
string actionNameOrId,
bool throwIfNotFound =
false)
132 return asset.FindAction(actionNameOrId, throwIfNotFound);
134 public int FindBinding(InputBinding bindingMask, out InputAction action)
136 return asset.FindBinding(bindingMask, out action);
140 private readonly InputActionMap m_HapticsXR;
141 private IHapticsXRActions m_HapticsXRActionsCallbackInterface;
142 private readonly InputAction m_HapticsXR_Left;
143 private readonly InputAction m_HapticsXR_Right;
144 public struct HapticsXRActions
146 private @IH_HapticsInput m_Wrapper;
147 public HapticsXRActions(@IH_HapticsInput wrapper) { m_Wrapper = wrapper; }
148 public InputAction @
Left => m_Wrapper.m_HapticsXR_Left;
149 public InputAction @
Right => m_Wrapper.m_HapticsXR_Right;
150 public InputActionMap Get() {
return m_Wrapper.m_HapticsXR; }
151 public void Enable() { Get().Enable(); }
152 public void Disable() { Get().Disable(); }
153 public bool enabled => Get().enabled;
154 public static implicit
operator InputActionMap(HapticsXRActions
set) {
return set.Get(); }
155 public void SetCallbacks(IHapticsXRActions instance)
157 if (m_Wrapper.m_HapticsXRActionsCallbackInterface !=
null)
159 @Left.started -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnLeft;
160 @Left.performed -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnLeft;
161 @Left.canceled -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnLeft;
162 @Right.started -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnRight;
163 @Right.performed -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnRight;
164 @Right.canceled -= m_Wrapper.m_HapticsXRActionsCallbackInterface.OnRight;
166 m_Wrapper.m_HapticsXRActionsCallbackInterface = instance;
167 if (instance !=
null)
169 @Left.started += instance.OnLeft;
170 @Left.performed += instance.OnLeft;
171 @Left.canceled += instance.OnLeft;
172 @Right.started += instance.OnRight;
173 @Right.performed += instance.OnRight;
174 @Right.canceled += instance.OnRight;
178 public HapticsXRActions @HapticsXR =>
new HapticsXRActions(
this);
179 public interface IHapticsXRActions
181 void OnLeft(InputAction.CallbackContext context);
182 void OnRight(InputAction.CallbackContext context);