XBox Controller.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. // GENERATED AUTOMATICALLY FROM 'Assets/Scripts/Player/XBox Controller.inputactions'
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine.InputSystem;
  6. using UnityEngine.InputSystem.Utilities;
  7. public class @XBoxController : IInputActionCollection, IDisposable
  8. {
  9. public InputActionAsset asset { get; }
  10. public @XBoxController()
  11. {
  12. asset = InputActionAsset.FromJson(@"{
  13. ""name"": ""XBox Controller"",
  14. ""maps"": [
  15. {
  16. ""name"": ""Movement"",
  17. ""id"": ""a2da98d8-97f6-4893-8dba-ccfdac38b280"",
  18. ""actions"": [
  19. {
  20. ""name"": ""Move"",
  21. ""type"": ""Value"",
  22. ""id"": ""ed4a400d-0cf5-44e8-a0ad-39e03dfb5de1"",
  23. ""expectedControlType"": ""Stick"",
  24. ""processors"": """",
  25. ""interactions"": """"
  26. },
  27. {
  28. ""name"": ""RotationL"",
  29. ""type"": ""Button"",
  30. ""id"": ""61a7e5e3-4579-4204-814d-74c1fc0aa871"",
  31. ""expectedControlType"": ""Button"",
  32. ""processors"": """",
  33. ""interactions"": """"
  34. },
  35. {
  36. ""name"": ""RotationR"",
  37. ""type"": ""Button"",
  38. ""id"": ""71f2855b-faad-479d-a0e5-0f7c5db06141"",
  39. ""expectedControlType"": ""Button"",
  40. ""processors"": """",
  41. ""interactions"": """"
  42. },
  43. {
  44. ""name"": ""Jump"",
  45. ""type"": ""Value"",
  46. ""id"": ""26a20c59-e1d7-4c69-a5df-a6e773c02e12"",
  47. ""expectedControlType"": ""Button"",
  48. ""processors"": """",
  49. ""interactions"": """"
  50. },
  51. {
  52. ""name"": ""Move forward"",
  53. ""type"": ""Button"",
  54. ""id"": ""c2a6af26-fcf7-4007-8d2a-71d979ca4921"",
  55. ""expectedControlType"": ""Button"",
  56. ""processors"": """",
  57. ""interactions"": """"
  58. },
  59. {
  60. ""name"": ""Move backward"",
  61. ""type"": ""Button"",
  62. ""id"": ""d12f4f56-6755-4b94-9c09-7f54a698ab65"",
  63. ""expectedControlType"": ""Button"",
  64. ""processors"": """",
  65. ""interactions"": """"
  66. }
  67. ],
  68. ""bindings"": [
  69. {
  70. ""name"": """",
  71. ""id"": ""a2aa966d-d88c-45af-bc17-7fa5def12118"",
  72. ""path"": ""<Gamepad>/leftStick"",
  73. ""interactions"": """",
  74. ""processors"": """",
  75. ""groups"": """",
  76. ""action"": ""Move"",
  77. ""isComposite"": false,
  78. ""isPartOfComposite"": false
  79. },
  80. {
  81. ""name"": """",
  82. ""id"": ""a065f1af-abdc-4d72-b733-a83381035547"",
  83. ""path"": ""<Gamepad>/leftStick/left"",
  84. ""interactions"": """",
  85. ""processors"": """",
  86. ""groups"": """",
  87. ""action"": ""RotationL"",
  88. ""isComposite"": false,
  89. ""isPartOfComposite"": false
  90. },
  91. {
  92. ""name"": """",
  93. ""id"": ""d86ff137-5263-423e-8510-73f368cb1564"",
  94. ""path"": ""<Keyboard>/a"",
  95. ""interactions"": """",
  96. ""processors"": """",
  97. ""groups"": """",
  98. ""action"": ""RotationL"",
  99. ""isComposite"": false,
  100. ""isPartOfComposite"": false
  101. },
  102. {
  103. ""name"": """",
  104. ""id"": ""66fb08fa-4865-4a2e-8253-064225f112a3"",
  105. ""path"": ""<Gamepad>/leftStick/right"",
  106. ""interactions"": """",
  107. ""processors"": """",
  108. ""groups"": """",
  109. ""action"": ""RotationR"",
  110. ""isComposite"": false,
  111. ""isPartOfComposite"": false
  112. },
  113. {
  114. ""name"": """",
  115. ""id"": ""a03dfacf-77f8-4563-ab4f-0a697f5077e6"",
  116. ""path"": ""<Keyboard>/d"",
  117. ""interactions"": """",
  118. ""processors"": """",
  119. ""groups"": """",
  120. ""action"": ""RotationR"",
  121. ""isComposite"": false,
  122. ""isPartOfComposite"": false
  123. },
  124. {
  125. ""name"": """",
  126. ""id"": ""63c2077e-bf44-43c8-aecf-993fa504b994"",
  127. ""path"": ""<Gamepad>/buttonSouth"",
  128. ""interactions"": """",
  129. ""processors"": """",
  130. ""groups"": """",
  131. ""action"": ""Jump"",
  132. ""isComposite"": false,
  133. ""isPartOfComposite"": false
  134. },
  135. {
  136. ""name"": """",
  137. ""id"": ""a70a6290-ce04-46f4-b526-008611cccb20"",
  138. ""path"": ""<Gamepad>/leftStick/up"",
  139. ""interactions"": """",
  140. ""processors"": """",
  141. ""groups"": """",
  142. ""action"": ""Move forward"",
  143. ""isComposite"": false,
  144. ""isPartOfComposite"": false
  145. },
  146. {
  147. ""name"": """",
  148. ""id"": ""459e7b01-8a37-4a61-b9ed-0e509beb0d4e"",
  149. ""path"": ""<Keyboard>/w"",
  150. ""interactions"": """",
  151. ""processors"": """",
  152. ""groups"": """",
  153. ""action"": ""Move forward"",
  154. ""isComposite"": false,
  155. ""isPartOfComposite"": false
  156. },
  157. {
  158. ""name"": """",
  159. ""id"": ""5dca0ff1-a0ba-4afa-8905-35f4189d152a"",
  160. ""path"": ""<Gamepad>/leftStick/down"",
  161. ""interactions"": """",
  162. ""processors"": """",
  163. ""groups"": """",
  164. ""action"": ""Move backward"",
  165. ""isComposite"": false,
  166. ""isPartOfComposite"": false
  167. },
  168. {
  169. ""name"": """",
  170. ""id"": ""f906de1b-81d4-49c4-a776-a5c22d268ede"",
  171. ""path"": ""<Keyboard>/s"",
  172. ""interactions"": """",
  173. ""processors"": """",
  174. ""groups"": """",
  175. ""action"": ""Move backward"",
  176. ""isComposite"": false,
  177. ""isPartOfComposite"": false
  178. }
  179. ]
  180. }
  181. ],
  182. ""controlSchemes"": []
  183. }");
  184. // Movement
  185. m_Movement = asset.FindActionMap("Movement", throwIfNotFound: true);
  186. m_Movement_Move = m_Movement.FindAction("Move", throwIfNotFound: true);
  187. m_Movement_RotationL = m_Movement.FindAction("RotationL", throwIfNotFound: true);
  188. m_Movement_RotationR = m_Movement.FindAction("RotationR", throwIfNotFound: true);
  189. m_Movement_Jump = m_Movement.FindAction("Jump", throwIfNotFound: true);
  190. m_Movement_Moveforward = m_Movement.FindAction("Move forward", throwIfNotFound: true);
  191. m_Movement_Movebackward = m_Movement.FindAction("Move backward", throwIfNotFound: true);
  192. }
  193. public void Dispose()
  194. {
  195. UnityEngine.Object.Destroy(asset);
  196. }
  197. public InputBinding? bindingMask
  198. {
  199. get => asset.bindingMask;
  200. set => asset.bindingMask = value;
  201. }
  202. public ReadOnlyArray<InputDevice>? devices
  203. {
  204. get => asset.devices;
  205. set => asset.devices = value;
  206. }
  207. public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
  208. public bool Contains(InputAction action)
  209. {
  210. return asset.Contains(action);
  211. }
  212. public IEnumerator<InputAction> GetEnumerator()
  213. {
  214. return asset.GetEnumerator();
  215. }
  216. IEnumerator IEnumerable.GetEnumerator()
  217. {
  218. return GetEnumerator();
  219. }
  220. public void Enable()
  221. {
  222. asset.Enable();
  223. }
  224. public void Disable()
  225. {
  226. asset.Disable();
  227. }
  228. // Movement
  229. private readonly InputActionMap m_Movement;
  230. private IMovementActions m_MovementActionsCallbackInterface;
  231. private readonly InputAction m_Movement_Move;
  232. private readonly InputAction m_Movement_RotationL;
  233. private readonly InputAction m_Movement_RotationR;
  234. private readonly InputAction m_Movement_Jump;
  235. private readonly InputAction m_Movement_Moveforward;
  236. private readonly InputAction m_Movement_Movebackward;
  237. public struct MovementActions
  238. {
  239. private @XBoxController m_Wrapper;
  240. public MovementActions(@XBoxController wrapper) { m_Wrapper = wrapper; }
  241. public InputAction @Move => m_Wrapper.m_Movement_Move;
  242. public InputAction @RotationL => m_Wrapper.m_Movement_RotationL;
  243. public InputAction @RotationR => m_Wrapper.m_Movement_RotationR;
  244. public InputAction @Jump => m_Wrapper.m_Movement_Jump;
  245. public InputAction @Moveforward => m_Wrapper.m_Movement_Moveforward;
  246. public InputAction @Movebackward => m_Wrapper.m_Movement_Movebackward;
  247. public InputActionMap Get() { return m_Wrapper.m_Movement; }
  248. public void Enable() { Get().Enable(); }
  249. public void Disable() { Get().Disable(); }
  250. public bool enabled => Get().enabled;
  251. public static implicit operator InputActionMap(MovementActions set) { return set.Get(); }
  252. public void SetCallbacks(IMovementActions instance)
  253. {
  254. if (m_Wrapper.m_MovementActionsCallbackInterface != null)
  255. {
  256. @Move.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMove;
  257. @Move.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMove;
  258. @Move.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMove;
  259. @RotationL.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationL;
  260. @RotationL.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationL;
  261. @RotationL.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationL;
  262. @RotationR.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationR;
  263. @RotationR.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationR;
  264. @RotationR.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnRotationR;
  265. @Jump.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
  266. @Jump.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
  267. @Jump.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
  268. @Moveforward.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMoveforward;
  269. @Moveforward.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMoveforward;
  270. @Moveforward.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMoveforward;
  271. @Movebackward.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovebackward;
  272. @Movebackward.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovebackward;
  273. @Movebackward.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovebackward;
  274. }
  275. m_Wrapper.m_MovementActionsCallbackInterface = instance;
  276. if (instance != null)
  277. {
  278. @Move.started += instance.OnMove;
  279. @Move.performed += instance.OnMove;
  280. @Move.canceled += instance.OnMove;
  281. @RotationL.started += instance.OnRotationL;
  282. @RotationL.performed += instance.OnRotationL;
  283. @RotationL.canceled += instance.OnRotationL;
  284. @RotationR.started += instance.OnRotationR;
  285. @RotationR.performed += instance.OnRotationR;
  286. @RotationR.canceled += instance.OnRotationR;
  287. @Jump.started += instance.OnJump;
  288. @Jump.performed += instance.OnJump;
  289. @Jump.canceled += instance.OnJump;
  290. @Moveforward.started += instance.OnMoveforward;
  291. @Moveforward.performed += instance.OnMoveforward;
  292. @Moveforward.canceled += instance.OnMoveforward;
  293. @Movebackward.started += instance.OnMovebackward;
  294. @Movebackward.performed += instance.OnMovebackward;
  295. @Movebackward.canceled += instance.OnMovebackward;
  296. }
  297. }
  298. }
  299. public MovementActions @Movement => new MovementActions(this);
  300. public interface IMovementActions
  301. {
  302. void OnMove(InputAction.CallbackContext context);
  303. void OnRotationL(InputAction.CallbackContext context);
  304. void OnRotationR(InputAction.CallbackContext context);
  305. void OnJump(InputAction.CallbackContext context);
  306. void OnMoveforward(InputAction.CallbackContext context);
  307. void OnMovebackward(InputAction.CallbackContext context);
  308. }
  309. }