InputActions.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
  4. // version 1.6.3
  5. // from Assets/Scripts/Framework/Input/InputActions.inputactions
  6. //
  7. // Changes to this file may cause incorrect behavior and will be lost if
  8. // the code is regenerated.
  9. // </auto-generated>
  10. //------------------------------------------------------------------------------
  11. using System;
  12. using System.Collections;
  13. using System.Collections.Generic;
  14. using UnityEngine.InputSystem;
  15. using UnityEngine.InputSystem.Utilities;
  16. public partial class @InputActions: IInputActionCollection2, IDisposable
  17. {
  18. public InputActionAsset asset { get; }
  19. public @InputActions()
  20. {
  21. asset = InputActionAsset.FromJson(@"{
  22. ""name"": ""InputActions"",
  23. ""maps"": [
  24. {
  25. ""name"": ""Player"",
  26. ""id"": ""d74358bd-072a-4dd1-bc06-3f3ea325362c"",
  27. ""actions"": [
  28. {
  29. ""name"": ""Move"",
  30. ""type"": ""Value"",
  31. ""id"": ""bd2dfc70-fc06-4ec6-8251-c32f5469873c"",
  32. ""expectedControlType"": ""Vector2"",
  33. ""processors"": """",
  34. ""interactions"": """",
  35. ""initialStateCheck"": true
  36. }
  37. ],
  38. ""bindings"": [
  39. {
  40. ""name"": ""WSAD"",
  41. ""id"": ""eaefd77b-0fa1-4a6d-8d69-825f41f26151"",
  42. ""path"": ""2DVector"",
  43. ""interactions"": """",
  44. ""processors"": """",
  45. ""groups"": """",
  46. ""action"": ""Move"",
  47. ""isComposite"": true,
  48. ""isPartOfComposite"": false
  49. },
  50. {
  51. ""name"": ""up"",
  52. ""id"": ""1992099a-6b5a-4d8f-9939-603b27bbdad6"",
  53. ""path"": ""<Keyboard>/w"",
  54. ""interactions"": """",
  55. ""processors"": """",
  56. ""groups"": """",
  57. ""action"": ""Move"",
  58. ""isComposite"": false,
  59. ""isPartOfComposite"": true
  60. },
  61. {
  62. ""name"": ""down"",
  63. ""id"": ""3863a9e9-4434-46b8-8df9-88fb33c2223d"",
  64. ""path"": ""<Keyboard>/s"",
  65. ""interactions"": """",
  66. ""processors"": """",
  67. ""groups"": """",
  68. ""action"": ""Move"",
  69. ""isComposite"": false,
  70. ""isPartOfComposite"": true
  71. },
  72. {
  73. ""name"": ""left"",
  74. ""id"": ""32773b70-da93-46d1-b4a6-3f9278ab9c9d"",
  75. ""path"": ""<Keyboard>/a"",
  76. ""interactions"": """",
  77. ""processors"": """",
  78. ""groups"": """",
  79. ""action"": ""Move"",
  80. ""isComposite"": false,
  81. ""isPartOfComposite"": true
  82. },
  83. {
  84. ""name"": ""right"",
  85. ""id"": ""ef35a655-58f5-413b-ac24-723e92c2bb22"",
  86. ""path"": ""<Keyboard>/d"",
  87. ""interactions"": """",
  88. ""processors"": """",
  89. ""groups"": """",
  90. ""action"": ""Move"",
  91. ""isComposite"": false,
  92. ""isPartOfComposite"": true
  93. },
  94. {
  95. ""name"": """",
  96. ""id"": ""95cc366a-fc0d-4528-8606-af3f57d241ad"",
  97. ""path"": ""<XRController>{RightHand}/secondary2DAxis"",
  98. ""interactions"": """",
  99. ""processors"": """",
  100. ""groups"": """",
  101. ""action"": ""Move"",
  102. ""isComposite"": false,
  103. ""isPartOfComposite"": false
  104. }
  105. ]
  106. },
  107. {
  108. ""name"": ""Camera"",
  109. ""id"": ""398f9572-c99f-4b1c-aaf4-50eec6e63e12"",
  110. ""actions"": [
  111. {
  112. ""name"": ""Pos"",
  113. ""type"": ""Value"",
  114. ""id"": ""f145a84d-8212-4053-ac1b-088630255209"",
  115. ""expectedControlType"": ""Vector3"",
  116. ""processors"": """",
  117. ""interactions"": """",
  118. ""initialStateCheck"": true
  119. },
  120. {
  121. ""name"": ""Rot"",
  122. ""type"": ""Value"",
  123. ""id"": ""b03d104d-c361-49e9-ac84-ae3f43ed5f89"",
  124. ""expectedControlType"": ""Quaternion"",
  125. ""processors"": """",
  126. ""interactions"": """",
  127. ""initialStateCheck"": true
  128. }
  129. ],
  130. ""bindings"": [
  131. {
  132. ""name"": """",
  133. ""id"": ""e1ebb432-b9df-4d5d-a7df-2dfba837bb45"",
  134. ""path"": ""<XRHMD>/centerEyePosition"",
  135. ""interactions"": """",
  136. ""processors"": """",
  137. ""groups"": """",
  138. ""action"": ""Pos"",
  139. ""isComposite"": false,
  140. ""isPartOfComposite"": false
  141. },
  142. {
  143. ""name"": """",
  144. ""id"": ""5ee823d7-ef26-42ea-997a-f4e31ac1247b"",
  145. ""path"": ""<XRHMD>/centerEyeRotation"",
  146. ""interactions"": """",
  147. ""processors"": """",
  148. ""groups"": """",
  149. ""action"": ""Rot"",
  150. ""isComposite"": false,
  151. ""isPartOfComposite"": false
  152. }
  153. ]
  154. },
  155. {
  156. ""name"": ""UI"",
  157. ""id"": ""493cc245-9a1f-4af1-8464-71a5520bcdcc"",
  158. ""actions"": [
  159. {
  160. ""name"": ""Click"",
  161. ""type"": ""PassThrough"",
  162. ""id"": ""65c95c22-82bd-4abd-b530-0642b131083e"",
  163. ""expectedControlType"": ""Button"",
  164. ""processors"": """",
  165. ""interactions"": """",
  166. ""initialStateCheck"": false
  167. },
  168. {
  169. ""name"": ""PointPos"",
  170. ""type"": ""PassThrough"",
  171. ""id"": ""3fd01d8f-58c0-4932-b7bc-e70d85f014b6"",
  172. ""expectedControlType"": ""Vector3"",
  173. ""processors"": """",
  174. ""interactions"": """",
  175. ""initialStateCheck"": false
  176. },
  177. {
  178. ""name"": ""PointRot"",
  179. ""type"": ""PassThrough"",
  180. ""id"": ""7148e43c-39d9-45a2-bdd4-fb1a8c2414c1"",
  181. ""expectedControlType"": ""Quaternion"",
  182. ""processors"": """",
  183. ""interactions"": """",
  184. ""initialStateCheck"": false
  185. }
  186. ],
  187. ""bindings"": [
  188. {
  189. ""name"": """",
  190. ""id"": ""ebda93de-abe4-41c2-911b-45a4dfb0dd2e"",
  191. ""path"": ""<PICO4TouchController>/triggerPressed"",
  192. ""interactions"": """",
  193. ""processors"": """",
  194. ""groups"": """",
  195. ""action"": ""Click"",
  196. ""isComposite"": false,
  197. ""isPartOfComposite"": false
  198. },
  199. {
  200. ""name"": """",
  201. ""id"": ""bd3da714-594e-4df8-929c-5742624c1e2a"",
  202. ""path"": ""<PICO4TouchController>/pointer/position"",
  203. ""interactions"": """",
  204. ""processors"": """",
  205. ""groups"": """",
  206. ""action"": ""PointPos"",
  207. ""isComposite"": false,
  208. ""isPartOfComposite"": false
  209. },
  210. {
  211. ""name"": """",
  212. ""id"": ""723e6d1f-4190-4298-988a-cc443a332f84"",
  213. ""path"": ""<PICO4TouchController>/pointer/rotation"",
  214. ""interactions"": """",
  215. ""processors"": """",
  216. ""groups"": """",
  217. ""action"": ""PointRot"",
  218. ""isComposite"": false,
  219. ""isPartOfComposite"": false
  220. }
  221. ]
  222. }
  223. ],
  224. ""controlSchemes"": []
  225. }");
  226. // Player
  227. m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
  228. m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
  229. // Camera
  230. m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
  231. m_Camera_Pos = m_Camera.FindAction("Pos", throwIfNotFound: true);
  232. m_Camera_Rot = m_Camera.FindAction("Rot", throwIfNotFound: true);
  233. // UI
  234. m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
  235. m_UI_Click = m_UI.FindAction("Click", throwIfNotFound: true);
  236. m_UI_PointPos = m_UI.FindAction("PointPos", throwIfNotFound: true);
  237. m_UI_PointRot = m_UI.FindAction("PointRot", throwIfNotFound: true);
  238. }
  239. public void Dispose()
  240. {
  241. UnityEngine.Object.Destroy(asset);
  242. }
  243. public InputBinding? bindingMask
  244. {
  245. get => asset.bindingMask;
  246. set => asset.bindingMask = value;
  247. }
  248. public ReadOnlyArray<InputDevice>? devices
  249. {
  250. get => asset.devices;
  251. set => asset.devices = value;
  252. }
  253. public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
  254. public bool Contains(InputAction action)
  255. {
  256. return asset.Contains(action);
  257. }
  258. public IEnumerator<InputAction> GetEnumerator()
  259. {
  260. return asset.GetEnumerator();
  261. }
  262. IEnumerator IEnumerable.GetEnumerator()
  263. {
  264. return GetEnumerator();
  265. }
  266. public void Enable()
  267. {
  268. asset.Enable();
  269. }
  270. public void Disable()
  271. {
  272. asset.Disable();
  273. }
  274. public IEnumerable<InputBinding> bindings => asset.bindings;
  275. public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
  276. {
  277. return asset.FindAction(actionNameOrId, throwIfNotFound);
  278. }
  279. public int FindBinding(InputBinding bindingMask, out InputAction action)
  280. {
  281. return asset.FindBinding(bindingMask, out action);
  282. }
  283. // Player
  284. private readonly InputActionMap m_Player;
  285. private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
  286. private readonly InputAction m_Player_Move;
  287. public struct PlayerActions
  288. {
  289. private @InputActions m_Wrapper;
  290. public PlayerActions(@InputActions wrapper) { m_Wrapper = wrapper; }
  291. public InputAction @Move => m_Wrapper.m_Player_Move;
  292. public InputActionMap Get() { return m_Wrapper.m_Player; }
  293. public void Enable() { Get().Enable(); }
  294. public void Disable() { Get().Disable(); }
  295. public bool enabled => Get().enabled;
  296. public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); }
  297. public void AddCallbacks(IPlayerActions instance)
  298. {
  299. if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return;
  300. m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance);
  301. @Move.started += instance.OnMove;
  302. @Move.performed += instance.OnMove;
  303. @Move.canceled += instance.OnMove;
  304. }
  305. private void UnregisterCallbacks(IPlayerActions instance)
  306. {
  307. @Move.started -= instance.OnMove;
  308. @Move.performed -= instance.OnMove;
  309. @Move.canceled -= instance.OnMove;
  310. }
  311. public void RemoveCallbacks(IPlayerActions instance)
  312. {
  313. if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance))
  314. UnregisterCallbacks(instance);
  315. }
  316. public void SetCallbacks(IPlayerActions instance)
  317. {
  318. foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
  319. UnregisterCallbacks(item);
  320. m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
  321. AddCallbacks(instance);
  322. }
  323. }
  324. public PlayerActions @Player => new PlayerActions(this);
  325. // Camera
  326. private readonly InputActionMap m_Camera;
  327. private List<ICameraActions> m_CameraActionsCallbackInterfaces = new List<ICameraActions>();
  328. private readonly InputAction m_Camera_Pos;
  329. private readonly InputAction m_Camera_Rot;
  330. public struct CameraActions
  331. {
  332. private @InputActions m_Wrapper;
  333. public CameraActions(@InputActions wrapper) { m_Wrapper = wrapper; }
  334. public InputAction @Pos => m_Wrapper.m_Camera_Pos;
  335. public InputAction @Rot => m_Wrapper.m_Camera_Rot;
  336. public InputActionMap Get() { return m_Wrapper.m_Camera; }
  337. public void Enable() { Get().Enable(); }
  338. public void Disable() { Get().Disable(); }
  339. public bool enabled => Get().enabled;
  340. public static implicit operator InputActionMap(CameraActions set) { return set.Get(); }
  341. public void AddCallbacks(ICameraActions instance)
  342. {
  343. if (instance == null || m_Wrapper.m_CameraActionsCallbackInterfaces.Contains(instance)) return;
  344. m_Wrapper.m_CameraActionsCallbackInterfaces.Add(instance);
  345. @Pos.started += instance.OnPos;
  346. @Pos.performed += instance.OnPos;
  347. @Pos.canceled += instance.OnPos;
  348. @Rot.started += instance.OnRot;
  349. @Rot.performed += instance.OnRot;
  350. @Rot.canceled += instance.OnRot;
  351. }
  352. private void UnregisterCallbacks(ICameraActions instance)
  353. {
  354. @Pos.started -= instance.OnPos;
  355. @Pos.performed -= instance.OnPos;
  356. @Pos.canceled -= instance.OnPos;
  357. @Rot.started -= instance.OnRot;
  358. @Rot.performed -= instance.OnRot;
  359. @Rot.canceled -= instance.OnRot;
  360. }
  361. public void RemoveCallbacks(ICameraActions instance)
  362. {
  363. if (m_Wrapper.m_CameraActionsCallbackInterfaces.Remove(instance))
  364. UnregisterCallbacks(instance);
  365. }
  366. public void SetCallbacks(ICameraActions instance)
  367. {
  368. foreach (var item in m_Wrapper.m_CameraActionsCallbackInterfaces)
  369. UnregisterCallbacks(item);
  370. m_Wrapper.m_CameraActionsCallbackInterfaces.Clear();
  371. AddCallbacks(instance);
  372. }
  373. }
  374. public CameraActions @Camera => new CameraActions(this);
  375. // UI
  376. private readonly InputActionMap m_UI;
  377. private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
  378. private readonly InputAction m_UI_Click;
  379. private readonly InputAction m_UI_PointPos;
  380. private readonly InputAction m_UI_PointRot;
  381. public struct UIActions
  382. {
  383. private @InputActions m_Wrapper;
  384. public UIActions(@InputActions wrapper) { m_Wrapper = wrapper; }
  385. public InputAction @Click => m_Wrapper.m_UI_Click;
  386. public InputAction @PointPos => m_Wrapper.m_UI_PointPos;
  387. public InputAction @PointRot => m_Wrapper.m_UI_PointRot;
  388. public InputActionMap Get() { return m_Wrapper.m_UI; }
  389. public void Enable() { Get().Enable(); }
  390. public void Disable() { Get().Disable(); }
  391. public bool enabled => Get().enabled;
  392. public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
  393. public void AddCallbacks(IUIActions instance)
  394. {
  395. if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return;
  396. m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance);
  397. @Click.started += instance.OnClick;
  398. @Click.performed += instance.OnClick;
  399. @Click.canceled += instance.OnClick;
  400. @PointPos.started += instance.OnPointPos;
  401. @PointPos.performed += instance.OnPointPos;
  402. @PointPos.canceled += instance.OnPointPos;
  403. @PointRot.started += instance.OnPointRot;
  404. @PointRot.performed += instance.OnPointRot;
  405. @PointRot.canceled += instance.OnPointRot;
  406. }
  407. private void UnregisterCallbacks(IUIActions instance)
  408. {
  409. @Click.started -= instance.OnClick;
  410. @Click.performed -= instance.OnClick;
  411. @Click.canceled -= instance.OnClick;
  412. @PointPos.started -= instance.OnPointPos;
  413. @PointPos.performed -= instance.OnPointPos;
  414. @PointPos.canceled -= instance.OnPointPos;
  415. @PointRot.started -= instance.OnPointRot;
  416. @PointRot.performed -= instance.OnPointRot;
  417. @PointRot.canceled -= instance.OnPointRot;
  418. }
  419. public void RemoveCallbacks(IUIActions instance)
  420. {
  421. if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance))
  422. UnregisterCallbacks(instance);
  423. }
  424. public void SetCallbacks(IUIActions instance)
  425. {
  426. foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
  427. UnregisterCallbacks(item);
  428. m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
  429. AddCallbacks(instance);
  430. }
  431. }
  432. public UIActions @UI => new UIActions(this);
  433. public interface IPlayerActions
  434. {
  435. void OnMove(InputAction.CallbackContext context);
  436. }
  437. public interface ICameraActions
  438. {
  439. void OnPos(InputAction.CallbackContext context);
  440. void OnRot(InputAction.CallbackContext context);
  441. }
  442. public interface IUIActions
  443. {
  444. void OnClick(InputAction.CallbackContext context);
  445. void OnPointPos(InputAction.CallbackContext context);
  446. void OnPointRot(InputAction.CallbackContext context);
  447. }
  448. }