Interhaptics SDK for Unity 1.6
Loading...
Searching...
No Matches
IH_HapticsInput.cs
Go to the documentation of this file.
1#if ENABLE_OPENXR
2
3//------------------------------------------------------------------------------
4// <auto-generated>
5// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
6// version 1.4.2
7// from Packages/com.interhaptics.core_sdk/Runtime/Platforms/OpenXR/IH_HapticsInput.inputactions
8//
9// Changes to this file may cause incorrect behavior and will be lost if
10// the code is regenerated.
11// </auto-generated>
12//------------------------------------------------------------------------------
13
14using System;
15using System.Collections;
16using System.Collections.Generic;
17using UnityEngine.InputSystem;
18using UnityEngine.InputSystem.Utilities;
19
20public partial class @IH_HapticsInput : IInputActionCollection2, IDisposable
21{
22 public InputActionAsset asset { get; }
23 public @IH_HapticsInput()
24 {
25 asset = InputActionAsset.FromJson(@"{
26 ""name"": ""IH_HapticsInput"",
27 ""maps"": [
28 {
29 ""name"": ""HapticsXR"",
30 ""id"": ""cb5a2207-7e84-46e3-8f8d-38e5b312def6"",
31 ""actions"": [
32 {
33 ""name"": ""Left"",
34 ""type"": ""Value"",
35 ""id"": ""98e14162-25d0-4640-89ae-c88f70e3e340"",
36 ""expectedControlType"": ""Haptic"",
37 ""processors"": """",
38 ""interactions"": """",
39 ""initialStateCheck"": true
40 },
41 {
42 ""name"": ""Right"",
43 ""type"": ""Value"",
44 ""id"": ""2f219f26-2872-45ef-9133-636d833ebcf6"",
45 ""expectedControlType"": ""Haptic"",
46 ""processors"": """",
47 ""interactions"": """",
48 ""initialStateCheck"": true
49 }
50 ],
51 ""bindings"": [
52 {
53 ""name"": """",
54 ""id"": ""07120713-2f08-4c23-af73-308fb7393ccd"",
55 ""path"": ""<XRController>{LeftHand}/haptic"",
56 ""interactions"": """",
57 ""processors"": """",
58 ""groups"": """",
59 ""action"": ""Left"",
60 ""isComposite"": false,
61 ""isPartOfComposite"": false
62 },
63 {
64 ""name"": """",
65 ""id"": ""21259124-14f0-4518-8ef2-52289145b374"",
66 ""path"": ""<XRController>{RightHand}/haptic"",
67 ""interactions"": """",
68 ""processors"": """",
69 ""groups"": """",
70 ""action"": ""Right"",
71 ""isComposite"": false,
72 ""isPartOfComposite"": false
73 }
74 ]
75 }
76 ],
77 ""controlSchemes"": []
78}");
79 // HapticsXR
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);
83 }
84
85 public void Dispose()
86 {
87 UnityEngine.Object.Destroy(asset);
88 }
89
90 public InputBinding? bindingMask
91 {
92 get => asset.bindingMask;
93 set => asset.bindingMask = value;
94 }
95
96 public ReadOnlyArray<InputDevice>? devices
97 {
98 get => asset.devices;
99 set => asset.devices = value;
100 }
101
102 public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
103
104 public bool Contains(InputAction action)
105 {
106 return asset.Contains(action);
107 }
108
109 public IEnumerator<InputAction> GetEnumerator()
110 {
111 return asset.GetEnumerator();
112 }
113
114 IEnumerator IEnumerable.GetEnumerator()
115 {
116 return GetEnumerator();
117 }
118
119 public void Enable()
120 {
121 asset.Enable();
122 }
123
124 public void Disable()
125 {
126 asset.Disable();
127 }
128 public IEnumerable<InputBinding> bindings => asset.bindings;
129
130 public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
131 {
132 return asset.FindAction(actionNameOrId, throwIfNotFound);
133 }
134 public int FindBinding(InputBinding bindingMask, out InputAction action)
135 {
136 return asset.FindBinding(bindingMask, out action);
137 }
138
139 // HapticsXR
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
145 {
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)
156 {
157 if (m_Wrapper.m_HapticsXRActionsCallbackInterface != null)
158 {
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;
165 }
166 m_Wrapper.m_HapticsXRActionsCallbackInterface = instance;
167 if (instance != null)
168 {
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;
175 }
176 }
177 }
178 public HapticsXRActions @HapticsXR => new HapticsXRActions(this);
179 public interface IHapticsXRActions
180 {
181 void OnLeft(InputAction.CallbackContext context);
182 void OnRight(InputAction.CallbackContext context);
183 }
184}
185#endif