No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InGameHintsActions.cs 17KB

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