InGameHintsActions.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. // GENERATED AUTOMATICALLY FROM 'Assets/Samples/InGameHints/InGameHintsActions.inputactions'
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine.InputSystem;
  6. using UnityEngine.InputSystem.Utilities;
  7. namespace UnityEngine.InputSystem.Samples.InGameHints
  8. {
  9. public class @InGameHintsActions: IInputActionCollection, IDisposable
  10. {
  11. public InputActionAsset asset { get; }
  12. public @InGameHintsActions()
  13. {
  14. asset = InputActionAsset.FromJson(@"{
  15. ""name"": ""InGameHintsActions"",
  16. ""maps"": [
  17. {
  18. ""name"": ""Gameplay"",
  19. ""id"": ""9af2d1b0-cc47-4300-854c-838acb4b168b"",
  20. ""actions"": [
  21. {
  22. ""name"": ""Move"",
  23. ""type"": ""Value"",
  24. ""id"": ""7e7492e7-1329-48bb-9fdc-279fd15473b4"",
  25. ""expectedControlType"": ""Vector2"",
  26. ""processors"": """",
  27. ""interactions"": """"
  28. },
  29. {
  30. ""name"": ""Look"",
  31. ""type"": ""Value"",
  32. ""id"": ""981fecc2-2e7a-4d6a-b041-00b47626e0a1"",
  33. ""expectedControlType"": ""Vector2"",
  34. ""processors"": """",
  35. ""interactions"": """"
  36. },
  37. {
  38. ""name"": ""PickUp"",
  39. ""type"": ""Button"",
  40. ""id"": ""5a59bbc2-a3d4-4cbd-88bb-01120d97dc69"",
  41. ""expectedControlType"": """",
  42. ""processors"": """",
  43. ""interactions"": """"
  44. },
  45. {
  46. ""name"": ""Drop"",
  47. ""type"": ""Button"",
  48. ""id"": ""f37bbe7e-e241-443f-b868-c784e1219f25"",
  49. ""expectedControlType"": """",
  50. ""processors"": """",
  51. ""interactions"": """"
  52. },
  53. {
  54. ""name"": ""Throw"",
  55. ""type"": ""Button"",
  56. ""id"": ""e450d71c-7cc5-4879-afb5-f3ed682d9824"",
  57. ""expectedControlType"": """",
  58. ""processors"": """",
  59. ""interactions"": """"
  60. }
  61. ],
  62. ""bindings"": [
  63. {
  64. ""name"": """",
  65. ""id"": ""5abc4d20-74bd-4f14-902f-2bd2cf59cc28"",
  66. ""path"": ""<Gamepad>/leftStick"",
  67. ""interactions"": """",
  68. ""processors"": """",
  69. ""groups"": ""Gamepad"",
  70. ""action"": ""Move"",
  71. ""isComposite"": false,
  72. ""isPartOfComposite"": false
  73. },
  74. {
  75. ""name"": ""WASD"",
  76. ""id"": ""b16141b1-1611-44db-9576-5a004eb451f2"",
  77. ""path"": ""2DVector"",
  78. ""interactions"": """",
  79. ""processors"": """",
  80. ""groups"": ""Keyboard&Mouse"",
  81. ""action"": ""Move"",
  82. ""isComposite"": true,
  83. ""isPartOfComposite"": false
  84. },
  85. {
  86. ""name"": ""up"",
  87. ""id"": ""2b20de3f-1ad8-4b42-b591-595edf60dced"",
  88. ""path"": ""<Keyboard>/w"",
  89. ""interactions"": """",
  90. ""processors"": """",
  91. ""groups"": ""Keyboard&Mouse"",
  92. ""action"": ""Move"",
  93. ""isComposite"": false,
  94. ""isPartOfComposite"": true
  95. },
  96. {
  97. ""name"": ""down"",
  98. ""id"": ""2f92eaa9-7f1f-4f42-9682-d105f7c2fc22"",
  99. ""path"": ""<Keyboard>/s"",
  100. ""interactions"": """",
  101. ""processors"": """",
  102. ""groups"": ""Keyboard&Mouse"",
  103. ""action"": ""Move"",
  104. ""isComposite"": false,
  105. ""isPartOfComposite"": true
  106. },
  107. {
  108. ""name"": ""left"",
  109. ""id"": ""3ba79a56-c5f8-4999-8203-bef8471f4bd8"",
  110. ""path"": ""<Keyboard>/a"",
  111. ""interactions"": """",
  112. ""processors"": """",
  113. ""groups"": ""Keyboard&Mouse"",
  114. ""action"": ""Move"",
  115. ""isComposite"": false,
  116. ""isPartOfComposite"": true
  117. },
  118. {
  119. ""name"": ""right"",
  120. ""id"": ""8d9acfe6-d844-4860-a151-01d6eb0dfb48"",
  121. ""path"": ""<Keyboard>/d"",
  122. ""interactions"": """",
  123. ""processors"": """",
  124. ""groups"": ""Keyboard&Mouse"",
  125. ""action"": ""Move"",
  126. ""isComposite"": false,
  127. ""isPartOfComposite"": true
  128. },
  129. {
  130. ""name"": """",
  131. ""id"": ""b69cbeb7-a5bf-4df1-8965-17d944634cef"",
  132. ""path"": ""<Gamepad>/rightStick"",
  133. ""interactions"": """",
  134. ""processors"": """",
  135. ""groups"": ""Gamepad"",
  136. ""action"": ""Look"",
  137. ""isComposite"": false,
  138. ""isPartOfComposite"": false
  139. },
  140. {
  141. ""name"": """",
  142. ""id"": ""b2ddefc9-49da-485d-be28-58e3ec3f8080"",
  143. ""path"": ""<Mouse>/delta"",
  144. ""interactions"": """",
  145. ""processors"": """",
  146. ""groups"": ""Keyboard&Mouse"",
  147. ""action"": ""Look"",
  148. ""isComposite"": false,
  149. ""isPartOfComposite"": false
  150. },
  151. {
  152. ""name"": """",
  153. ""id"": ""92182492-7b62-47e0-94ad-53d9937d9905"",
  154. ""path"": ""<Gamepad>/buttonSouth"",
  155. ""interactions"": """",
  156. ""processors"": """",
  157. ""groups"": ""Gamepad"",
  158. ""action"": ""PickUp"",
  159. ""isComposite"": false,
  160. ""isPartOfComposite"": false
  161. },
  162. {
  163. ""name"": """",
  164. ""id"": ""e20635aa-ffe7-4ed9-8802-96c039d26a8f"",
  165. ""path"": ""<Keyboard>/q"",
  166. ""interactions"": """",
  167. ""processors"": """",
  168. ""groups"": ""Keyboard&Mouse"",
  169. ""action"": ""PickUp"",
  170. ""isComposite"": false,
  171. ""isPartOfComposite"": false
  172. },
  173. {
  174. ""name"": """",
  175. ""id"": ""f5571cd9-1166-4ddc-9071-37dc597b1d4e"",
  176. ""path"": ""<Gamepad>/buttonEast"",
  177. ""interactions"": """",
  178. ""processors"": """",
  179. ""groups"": ""Gamepad"",
  180. ""action"": ""Drop"",
  181. ""isComposite"": false,
  182. ""isPartOfComposite"": false
  183. },
  184. {
  185. ""name"": """",
  186. ""id"": ""950f549e-ec9c-4d03-aeff-f09ec4031d01"",
  187. ""path"": ""<Keyboard>/e"",
  188. ""interactions"": """",
  189. ""processors"": """",
  190. ""groups"": ""Keyboard&Mouse"",
  191. ""action"": ""Drop"",
  192. ""isComposite"": false,
  193. ""isPartOfComposite"": false
  194. },
  195. {
  196. ""name"": """",
  197. ""id"": ""47d1952d-797b-4f5b-986c-654b8e479deb"",
  198. ""path"": ""<Gamepad>/buttonSouth"",
  199. ""interactions"": """",
  200. ""processors"": """",
  201. ""groups"": ""Gamepad"",
  202. ""action"": ""Throw"",
  203. ""isComposite"": false,
  204. ""isPartOfComposite"": false
  205. },
  206. {
  207. ""name"": """",
  208. ""id"": ""02e2493d-1eb3-4334-9d25-92f2b5e21399"",
  209. ""path"": ""<Keyboard>/space"",
  210. ""interactions"": """",
  211. ""processors"": """",
  212. ""groups"": ""Keyboard&Mouse"",
  213. ""action"": ""Throw"",
  214. ""isComposite"": false,
  215. ""isPartOfComposite"": false
  216. }
  217. ]
  218. }
  219. ],
  220. ""controlSchemes"": [
  221. {
  222. ""name"": ""Gamepad"",
  223. ""bindingGroup"": ""Gamepad"",
  224. ""devices"": [
  225. {
  226. ""devicePath"": ""<Gamepad>"",
  227. ""isOptional"": false,
  228. ""isOR"": false
  229. }
  230. ]
  231. },
  232. {
  233. ""name"": ""Keyboard&Mouse"",
  234. ""bindingGroup"": ""Keyboard&Mouse"",
  235. ""devices"": [
  236. {
  237. ""devicePath"": ""<Keyboard>"",
  238. ""isOptional"": false,
  239. ""isOR"": false
  240. },
  241. {
  242. ""devicePath"": ""<Mouse>"",
  243. ""isOptional"": false,
  244. ""isOR"": false
  245. }
  246. ]
  247. }
  248. ]
  249. }");
  250. // Gameplay
  251. m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true);
  252. m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true);
  253. m_Gameplay_Look = m_Gameplay.FindAction("Look", throwIfNotFound: true);
  254. m_Gameplay_PickUp = m_Gameplay.FindAction("PickUp", throwIfNotFound: true);
  255. m_Gameplay_Drop = m_Gameplay.FindAction("Drop", throwIfNotFound: true);
  256. m_Gameplay_Throw = m_Gameplay.FindAction("Throw", throwIfNotFound: true);
  257. }
  258. public void Dispose()
  259. {
  260. UnityEngine.Object.Destroy(asset);
  261. }
  262. public InputBinding? bindingMask
  263. {
  264. get => asset.bindingMask;
  265. set => asset.bindingMask = value;
  266. }
  267. public ReadOnlyArray<InputDevice>? devices
  268. {
  269. get => asset.devices;
  270. set => asset.devices = value;
  271. }
  272. public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
  273. public bool Contains(InputAction action)
  274. {
  275. return asset.Contains(action);
  276. }
  277. public IEnumerator<InputAction> GetEnumerator()
  278. {
  279. return asset.GetEnumerator();
  280. }
  281. IEnumerator IEnumerable.GetEnumerator()
  282. {
  283. return GetEnumerator();
  284. }
  285. public void Enable()
  286. {
  287. asset.Enable();
  288. }
  289. public void Disable()
  290. {
  291. asset.Disable();
  292. }
  293. // Gameplay
  294. private readonly InputActionMap m_Gameplay;
  295. private IGameplayActions m_GameplayActionsCallbackInterface;
  296. private readonly InputAction m_Gameplay_Move;
  297. private readonly InputAction m_Gameplay_Look;
  298. private readonly InputAction m_Gameplay_PickUp;
  299. private readonly InputAction m_Gameplay_Drop;
  300. private readonly InputAction m_Gameplay_Throw;
  301. public struct GameplayActions
  302. {
  303. private @InGameHintsActions m_Wrapper;
  304. public GameplayActions(@InGameHintsActions wrapper) { m_Wrapper = wrapper; }
  305. public InputAction @Move => m_Wrapper.m_Gameplay_Move;
  306. public InputAction @Look => m_Wrapper.m_Gameplay_Look;
  307. public InputAction @PickUp => m_Wrapper.m_Gameplay_PickUp;
  308. public InputAction @Drop => m_Wrapper.m_Gameplay_Drop;
  309. public InputAction @Throw => m_Wrapper.m_Gameplay_Throw;
  310. public InputActionMap Get() { return m_Wrapper.m_Gameplay; }
  311. public void Enable() { Get().Enable(); }
  312. public void Disable() { Get().Disable(); }
  313. public bool enabled => Get().enabled;
  314. public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); }
  315. public void SetCallbacks(IGameplayActions instance)
  316. {
  317. if (m_Wrapper.m_GameplayActionsCallbackInterface != null)
  318. {
  319. @Move.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
  320. @Move.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
  321. @Move.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
  322. @Look.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook;
  323. @Look.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook;
  324. @Look.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook;
  325. @PickUp.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp;
  326. @PickUp.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp;
  327. @PickUp.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp;
  328. @Drop.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop;
  329. @Drop.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop;
  330. @Drop.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop;
  331. @Throw.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow;
  332. @Throw.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow;
  333. @Throw.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow;
  334. }
  335. m_Wrapper.m_GameplayActionsCallbackInterface = instance;
  336. if (instance != null)
  337. {
  338. @Move.started += instance.OnMove;
  339. @Move.performed += instance.OnMove;
  340. @Move.canceled += instance.OnMove;
  341. @Look.started += instance.OnLook;
  342. @Look.performed += instance.OnLook;
  343. @Look.canceled += instance.OnLook;
  344. @PickUp.started += instance.OnPickUp;
  345. @PickUp.performed += instance.OnPickUp;
  346. @PickUp.canceled += instance.OnPickUp;
  347. @Drop.started += instance.OnDrop;
  348. @Drop.performed += instance.OnDrop;
  349. @Drop.canceled += instance.OnDrop;
  350. @Throw.started += instance.OnThrow;
  351. @Throw.performed += instance.OnThrow;
  352. @Throw.canceled += instance.OnThrow;
  353. }
  354. }
  355. }
  356. public GameplayActions @Gameplay => new GameplayActions(this);
  357. private int m_GamepadSchemeIndex = -1;
  358. public InputControlScheme GamepadScheme
  359. {
  360. get
  361. {
  362. if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad");
  363. return asset.controlSchemes[m_GamepadSchemeIndex];
  364. }
  365. }
  366. private int m_KeyboardMouseSchemeIndex = -1;
  367. public InputControlScheme KeyboardMouseScheme
  368. {
  369. get
  370. {
  371. if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard&Mouse");
  372. return asset.controlSchemes[m_KeyboardMouseSchemeIndex];
  373. }
  374. }
  375. public interface IGameplayActions
  376. {
  377. void OnMove(InputAction.CallbackContext context);
  378. void OnLook(InputAction.CallbackContext context);
  379. void OnPickUp(InputAction.CallbackContext context);
  380. void OnDrop(InputAction.CallbackContext context);
  381. void OnThrow(InputAction.CallbackContext context);
  382. }
  383. }
  384. }