InputActions.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
  4. // version 1.5.1
  5. // from Assets/Defs/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"": ""c3a65a74-d8a0-4b42-a881-420d05e6ac1f"",
  27. ""actions"": [
  28. {
  29. ""name"": ""Move"",
  30. ""type"": ""Value"",
  31. ""id"": ""7cb39be5-6517-4a02-8242-00eb49325f65"",
  32. ""expectedControlType"": ""Vector2"",
  33. ""processors"": """",
  34. ""interactions"": """",
  35. ""initialStateCheck"": true
  36. },
  37. {
  38. ""name"": ""Jump"",
  39. ""type"": ""Button"",
  40. ""id"": ""4e602a82-721c-42c3-87c8-8fe0c196c42f"",
  41. ""expectedControlType"": ""Button"",
  42. ""processors"": """",
  43. ""interactions"": """",
  44. ""initialStateCheck"": false
  45. },
  46. {
  47. ""name"": ""UIRot"",
  48. ""type"": ""Value"",
  49. ""id"": ""0cba42ec-bb9f-44a9-914d-b9edfb4136a0"",
  50. ""expectedControlType"": ""Vector2"",
  51. ""processors"": """",
  52. ""interactions"": """",
  53. ""initialStateCheck"": true
  54. },
  55. {
  56. ""name"": ""PressDown"",
  57. ""type"": ""Button"",
  58. ""id"": ""dcc64a51-10fb-41c2-a496-fdffe2b6307e"",
  59. ""expectedControlType"": ""Button"",
  60. ""processors"": """",
  61. ""interactions"": """",
  62. ""initialStateCheck"": false
  63. },
  64. {
  65. ""name"": ""Touch0"",
  66. ""type"": ""Value"",
  67. ""id"": ""4184bff5-7d5e-4eb0-a2b6-c3e57c323516"",
  68. ""expectedControlType"": ""Vector2"",
  69. ""processors"": """",
  70. ""interactions"": """",
  71. ""initialStateCheck"": true
  72. },
  73. {
  74. ""name"": ""Touch1"",
  75. ""type"": ""Value"",
  76. ""id"": ""857e8ab0-8f79-4c77-9c21-974520656eea"",
  77. ""expectedControlType"": ""Vector2"",
  78. ""processors"": """",
  79. ""interactions"": """",
  80. ""initialStateCheck"": true
  81. },
  82. {
  83. ""name"": ""Camera"",
  84. ""type"": ""Value"",
  85. ""id"": ""bf0b2066-2bff-42a3-9b65-402f6d8066a9"",
  86. ""expectedControlType"": ""Vector2"",
  87. ""processors"": """",
  88. ""interactions"": """",
  89. ""initialStateCheck"": true
  90. }
  91. ],
  92. ""bindings"": [
  93. {
  94. ""name"": ""WASD"",
  95. ""id"": ""bab08eb7-782f-4e21-9a72-6b3c190c0e0f"",
  96. ""path"": ""2DVector"",
  97. ""interactions"": """",
  98. ""processors"": """",
  99. ""groups"": """",
  100. ""action"": ""Move"",
  101. ""isComposite"": true,
  102. ""isPartOfComposite"": false
  103. },
  104. {
  105. ""name"": ""up"",
  106. ""id"": ""b78b9ec3-a775-4e11-86c0-e72efad24452"",
  107. ""path"": ""<Keyboard>/w"",
  108. ""interactions"": """",
  109. ""processors"": """",
  110. ""groups"": """",
  111. ""action"": ""Move"",
  112. ""isComposite"": false,
  113. ""isPartOfComposite"": true
  114. },
  115. {
  116. ""name"": ""down"",
  117. ""id"": ""a108c3a8-d606-48b1-a267-1230d4924a06"",
  118. ""path"": ""<Keyboard>/s"",
  119. ""interactions"": """",
  120. ""processors"": """",
  121. ""groups"": """",
  122. ""action"": ""Move"",
  123. ""isComposite"": false,
  124. ""isPartOfComposite"": true
  125. },
  126. {
  127. ""name"": ""left"",
  128. ""id"": ""ef42e706-084a-441a-971c-b37b9ff51d54"",
  129. ""path"": ""<Keyboard>/a"",
  130. ""interactions"": """",
  131. ""processors"": """",
  132. ""groups"": """",
  133. ""action"": ""Move"",
  134. ""isComposite"": false,
  135. ""isPartOfComposite"": true
  136. },
  137. {
  138. ""name"": ""right"",
  139. ""id"": ""0671f667-a5f4-4be0-b096-f30e049e8b67"",
  140. ""path"": ""<Keyboard>/d"",
  141. ""interactions"": """",
  142. ""processors"": """",
  143. ""groups"": """",
  144. ""action"": ""Move"",
  145. ""isComposite"": false,
  146. ""isPartOfComposite"": true
  147. },
  148. {
  149. ""name"": """",
  150. ""id"": ""8f6591a1-b519-45a1-8f85-0900c22e0bfa"",
  151. ""path"": ""<Gamepad>/leftStick"",
  152. ""interactions"": """",
  153. ""processors"": """",
  154. ""groups"": """",
  155. ""action"": ""Move"",
  156. ""isComposite"": false,
  157. ""isPartOfComposite"": false
  158. },
  159. {
  160. ""name"": """",
  161. ""id"": ""6ffa5d62-d6f9-4e28-ac49-1194132095e0"",
  162. ""path"": ""<Keyboard>/space"",
  163. ""interactions"": """",
  164. ""processors"": """",
  165. ""groups"": """",
  166. ""action"": ""Jump"",
  167. ""isComposite"": false,
  168. ""isPartOfComposite"": false
  169. },
  170. {
  171. ""name"": """",
  172. ""id"": ""f4e974b0-ee7b-4e3e-a28e-2bd654b60a8f"",
  173. ""path"": ""<Gamepad>/buttonSouth"",
  174. ""interactions"": """",
  175. ""processors"": """",
  176. ""groups"": """",
  177. ""action"": ""Jump"",
  178. ""isComposite"": false,
  179. ""isPartOfComposite"": false
  180. },
  181. {
  182. ""name"": """",
  183. ""id"": ""d4ccbb01-d9b6-4358-a81e-c96621bfb98a"",
  184. ""path"": ""<Mouse>/delta"",
  185. ""interactions"": """",
  186. ""processors"": ""ScaleVector2"",
  187. ""groups"": """",
  188. ""action"": ""UIRot"",
  189. ""isComposite"": false,
  190. ""isPartOfComposite"": false
  191. },
  192. {
  193. ""name"": """",
  194. ""id"": ""ea41aaa3-71af-4a0f-a472-46b9f582153a"",
  195. ""path"": ""<Touchscreen>/touch0/delta"",
  196. ""interactions"": """",
  197. ""processors"": """",
  198. ""groups"": """",
  199. ""action"": ""UIRot"",
  200. ""isComposite"": false,
  201. ""isPartOfComposite"": false
  202. },
  203. {
  204. ""name"": """",
  205. ""id"": ""4077713c-4a4a-4a7d-b59c-3844eff339b8"",
  206. ""path"": ""<Mouse>/leftButton"",
  207. ""interactions"": """",
  208. ""processors"": """",
  209. ""groups"": """",
  210. ""action"": ""PressDown"",
  211. ""isComposite"": false,
  212. ""isPartOfComposite"": false
  213. },
  214. {
  215. ""name"": """",
  216. ""id"": ""1f3ce28e-26f4-4475-9185-1d065b52e2b8"",
  217. ""path"": ""<Pointer>/press"",
  218. ""interactions"": """",
  219. ""processors"": """",
  220. ""groups"": """",
  221. ""action"": ""PressDown"",
  222. ""isComposite"": false,
  223. ""isPartOfComposite"": false
  224. },
  225. {
  226. ""name"": """",
  227. ""id"": ""ce253bba-0484-4170-ac71-817a0d336bb2"",
  228. ""path"": ""<Touchscreen>/touch0/delta"",
  229. ""interactions"": """",
  230. ""processors"": """",
  231. ""groups"": """",
  232. ""action"": ""Touch0"",
  233. ""isComposite"": false,
  234. ""isPartOfComposite"": false
  235. },
  236. {
  237. ""name"": """",
  238. ""id"": ""2777540a-a6da-42d2-9968-207cb69b0dc6"",
  239. ""path"": ""<Touchscreen>/touch1/delta"",
  240. ""interactions"": """",
  241. ""processors"": """",
  242. ""groups"": """",
  243. ""action"": ""Touch1"",
  244. ""isComposite"": false,
  245. ""isPartOfComposite"": false
  246. },
  247. {
  248. ""name"": """",
  249. ""id"": ""22ca5a7c-ec1e-4637-bf79-ae08d35db535"",
  250. ""path"": ""<Mouse>/delta"",
  251. ""interactions"": """",
  252. ""processors"": """",
  253. ""groups"": """",
  254. ""action"": ""Camera"",
  255. ""isComposite"": false,
  256. ""isPartOfComposite"": false
  257. }
  258. ]
  259. }
  260. ],
  261. ""controlSchemes"": []
  262. }");
  263. // Player
  264. m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
  265. m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
  266. m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
  267. m_Player_UIRot = m_Player.FindAction("UIRot", throwIfNotFound: true);
  268. m_Player_PressDown = m_Player.FindAction("PressDown", throwIfNotFound: true);
  269. m_Player_Touch0 = m_Player.FindAction("Touch0", throwIfNotFound: true);
  270. m_Player_Touch1 = m_Player.FindAction("Touch1", throwIfNotFound: true);
  271. m_Player_Camera = m_Player.FindAction("Camera", throwIfNotFound: true);
  272. }
  273. public void Dispose()
  274. {
  275. UnityEngine.Object.Destroy(asset);
  276. }
  277. public InputBinding? bindingMask
  278. {
  279. get => asset.bindingMask;
  280. set => asset.bindingMask = value;
  281. }
  282. public ReadOnlyArray<InputDevice>? devices
  283. {
  284. get => asset.devices;
  285. set => asset.devices = value;
  286. }
  287. public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
  288. public bool Contains(InputAction action)
  289. {
  290. return asset.Contains(action);
  291. }
  292. public IEnumerator<InputAction> GetEnumerator()
  293. {
  294. return asset.GetEnumerator();
  295. }
  296. IEnumerator IEnumerable.GetEnumerator()
  297. {
  298. return GetEnumerator();
  299. }
  300. public void Enable()
  301. {
  302. asset.Enable();
  303. }
  304. public void Disable()
  305. {
  306. asset.Disable();
  307. }
  308. public IEnumerable<InputBinding> bindings => asset.bindings;
  309. public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
  310. {
  311. return asset.FindAction(actionNameOrId, throwIfNotFound);
  312. }
  313. public int FindBinding(InputBinding bindingMask, out InputAction action)
  314. {
  315. return asset.FindBinding(bindingMask, out action);
  316. }
  317. // Player
  318. private readonly InputActionMap m_Player;
  319. private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
  320. private readonly InputAction m_Player_Move;
  321. private readonly InputAction m_Player_Jump;
  322. private readonly InputAction m_Player_UIRot;
  323. private readonly InputAction m_Player_PressDown;
  324. private readonly InputAction m_Player_Touch0;
  325. private readonly InputAction m_Player_Touch1;
  326. private readonly InputAction m_Player_Camera;
  327. public struct PlayerActions
  328. {
  329. private @InputActions m_Wrapper;
  330. public PlayerActions(@InputActions wrapper) { m_Wrapper = wrapper; }
  331. public InputAction @Move => m_Wrapper.m_Player_Move;
  332. public InputAction @Jump => m_Wrapper.m_Player_Jump;
  333. public InputAction @UIRot => m_Wrapper.m_Player_UIRot;
  334. public InputAction @PressDown => m_Wrapper.m_Player_PressDown;
  335. public InputAction @Touch0 => m_Wrapper.m_Player_Touch0;
  336. public InputAction @Touch1 => m_Wrapper.m_Player_Touch1;
  337. public InputAction @Camera => m_Wrapper.m_Player_Camera;
  338. public InputActionMap Get() { return m_Wrapper.m_Player; }
  339. public void Enable() { Get().Enable(); }
  340. public void Disable() { Get().Disable(); }
  341. public bool enabled => Get().enabled;
  342. public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); }
  343. public void AddCallbacks(IPlayerActions instance)
  344. {
  345. if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return;
  346. m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance);
  347. @Move.started += instance.OnMove;
  348. @Move.performed += instance.OnMove;
  349. @Move.canceled += instance.OnMove;
  350. @Jump.started += instance.OnJump;
  351. @Jump.performed += instance.OnJump;
  352. @Jump.canceled += instance.OnJump;
  353. @UIRot.started += instance.OnUIRot;
  354. @UIRot.performed += instance.OnUIRot;
  355. @UIRot.canceled += instance.OnUIRot;
  356. @PressDown.started += instance.OnPressDown;
  357. @PressDown.performed += instance.OnPressDown;
  358. @PressDown.canceled += instance.OnPressDown;
  359. @Touch0.started += instance.OnTouch0;
  360. @Touch0.performed += instance.OnTouch0;
  361. @Touch0.canceled += instance.OnTouch0;
  362. @Touch1.started += instance.OnTouch1;
  363. @Touch1.performed += instance.OnTouch1;
  364. @Touch1.canceled += instance.OnTouch1;
  365. @Camera.started += instance.OnCamera;
  366. @Camera.performed += instance.OnCamera;
  367. @Camera.canceled += instance.OnCamera;
  368. }
  369. private void UnregisterCallbacks(IPlayerActions instance)
  370. {
  371. @Move.started -= instance.OnMove;
  372. @Move.performed -= instance.OnMove;
  373. @Move.canceled -= instance.OnMove;
  374. @Jump.started -= instance.OnJump;
  375. @Jump.performed -= instance.OnJump;
  376. @Jump.canceled -= instance.OnJump;
  377. @UIRot.started -= instance.OnUIRot;
  378. @UIRot.performed -= instance.OnUIRot;
  379. @UIRot.canceled -= instance.OnUIRot;
  380. @PressDown.started -= instance.OnPressDown;
  381. @PressDown.performed -= instance.OnPressDown;
  382. @PressDown.canceled -= instance.OnPressDown;
  383. @Touch0.started -= instance.OnTouch0;
  384. @Touch0.performed -= instance.OnTouch0;
  385. @Touch0.canceled -= instance.OnTouch0;
  386. @Touch1.started -= instance.OnTouch1;
  387. @Touch1.performed -= instance.OnTouch1;
  388. @Touch1.canceled -= instance.OnTouch1;
  389. @Camera.started -= instance.OnCamera;
  390. @Camera.performed -= instance.OnCamera;
  391. @Camera.canceled -= instance.OnCamera;
  392. }
  393. public void RemoveCallbacks(IPlayerActions instance)
  394. {
  395. if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance))
  396. UnregisterCallbacks(instance);
  397. }
  398. public void SetCallbacks(IPlayerActions instance)
  399. {
  400. foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
  401. UnregisterCallbacks(item);
  402. m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
  403. AddCallbacks(instance);
  404. }
  405. }
  406. public PlayerActions @Player => new PlayerActions(this);
  407. public interface IPlayerActions
  408. {
  409. void OnMove(InputAction.CallbackContext context);
  410. void OnJump(InputAction.CallbackContext context);
  411. void OnUIRot(InputAction.CallbackContext context);
  412. void OnPressDown(InputAction.CallbackContext context);
  413. void OnTouch0(InputAction.CallbackContext context);
  414. void OnTouch1(InputAction.CallbackContext context);
  415. void OnCamera(InputAction.CallbackContext context);
  416. }
  417. }