InputCommon.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
  4. // version 1.5.1
  5. // from Assets/GFMain/Scripts/AOT/InputSystem/InputCommon.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. namespace GFMain
  17. {
  18. public partial class @InputCommon: IInputActionCollection2, IDisposable
  19. {
  20. public InputActionAsset asset { get; }
  21. public @InputCommon()
  22. {
  23. asset = InputActionAsset.FromJson(@"{
  24. ""name"": ""InputCommon"",
  25. ""maps"": [
  26. {
  27. ""name"": ""Common"",
  28. ""id"": ""5d005a13-6210-4f4b-a073-791e301875a6"",
  29. ""actions"": [
  30. {
  31. ""name"": ""OpenDebug"",
  32. ""type"": ""Button"",
  33. ""id"": ""7856085b-2043-4b07-bb9f-a46e974b491a"",
  34. ""expectedControlType"": ""Button"",
  35. ""processors"": """",
  36. ""interactions"": """",
  37. ""initialStateCheck"": false
  38. }
  39. ],
  40. ""bindings"": [
  41. {
  42. ""name"": """",
  43. ""id"": ""19cfa1e9-a169-4a83-9358-6d06f8dc2655"",
  44. ""path"": ""<Keyboard>/f2"",
  45. ""interactions"": ""MultiTap(tapCount=5)"",
  46. ""processors"": """",
  47. ""groups"": """",
  48. ""action"": ""OpenDebug"",
  49. ""isComposite"": false,
  50. ""isPartOfComposite"": false
  51. }
  52. ]
  53. }
  54. ],
  55. ""controlSchemes"": []
  56. }");
  57. // Common
  58. m_Common = asset.FindActionMap("Common", throwIfNotFound: true);
  59. m_Common_OpenDebug = m_Common.FindAction("OpenDebug", throwIfNotFound: true);
  60. }
  61. public void Dispose()
  62. {
  63. UnityEngine.Object.Destroy(asset);
  64. }
  65. public InputBinding? bindingMask
  66. {
  67. get => asset.bindingMask;
  68. set => asset.bindingMask = value;
  69. }
  70. public ReadOnlyArray<InputDevice>? devices
  71. {
  72. get => asset.devices;
  73. set => asset.devices = value;
  74. }
  75. public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
  76. public bool Contains(InputAction action)
  77. {
  78. return asset.Contains(action);
  79. }
  80. public IEnumerator<InputAction> GetEnumerator()
  81. {
  82. return asset.GetEnumerator();
  83. }
  84. IEnumerator IEnumerable.GetEnumerator()
  85. {
  86. return GetEnumerator();
  87. }
  88. public void Enable()
  89. {
  90. asset.Enable();
  91. }
  92. public void Disable()
  93. {
  94. asset.Disable();
  95. }
  96. public IEnumerable<InputBinding> bindings => asset.bindings;
  97. public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
  98. {
  99. return asset.FindAction(actionNameOrId, throwIfNotFound);
  100. }
  101. public int FindBinding(InputBinding bindingMask, out InputAction action)
  102. {
  103. return asset.FindBinding(bindingMask, out action);
  104. }
  105. // Common
  106. private readonly InputActionMap m_Common;
  107. private List<ICommonActions> m_CommonActionsCallbackInterfaces = new List<ICommonActions>();
  108. private readonly InputAction m_Common_OpenDebug;
  109. public struct CommonActions
  110. {
  111. private @InputCommon m_Wrapper;
  112. public CommonActions(@InputCommon wrapper) { m_Wrapper = wrapper; }
  113. public InputAction @OpenDebug => m_Wrapper.m_Common_OpenDebug;
  114. public InputActionMap Get() { return m_Wrapper.m_Common; }
  115. public void Enable() { Get().Enable(); }
  116. public void Disable() { Get().Disable(); }
  117. public bool enabled => Get().enabled;
  118. public static implicit operator InputActionMap(CommonActions set) { return set.Get(); }
  119. public void AddCallbacks(ICommonActions instance)
  120. {
  121. if (instance == null || m_Wrapper.m_CommonActionsCallbackInterfaces.Contains(instance)) return;
  122. m_Wrapper.m_CommonActionsCallbackInterfaces.Add(instance);
  123. @OpenDebug.started += instance.OnOpenDebug;
  124. @OpenDebug.performed += instance.OnOpenDebug;
  125. @OpenDebug.canceled += instance.OnOpenDebug;
  126. }
  127. private void UnregisterCallbacks(ICommonActions instance)
  128. {
  129. @OpenDebug.started -= instance.OnOpenDebug;
  130. @OpenDebug.performed -= instance.OnOpenDebug;
  131. @OpenDebug.canceled -= instance.OnOpenDebug;
  132. }
  133. public void RemoveCallbacks(ICommonActions instance)
  134. {
  135. if (m_Wrapper.m_CommonActionsCallbackInterfaces.Remove(instance))
  136. UnregisterCallbacks(instance);
  137. }
  138. public void SetCallbacks(ICommonActions instance)
  139. {
  140. foreach (var item in m_Wrapper.m_CommonActionsCallbackInterfaces)
  141. UnregisterCallbacks(item);
  142. m_Wrapper.m_CommonActionsCallbackInterfaces.Clear();
  143. AddCallbacks(instance);
  144. }
  145. }
  146. public CommonActions @Common => new CommonActions(this);
  147. public interface ICommonActions
  148. {
  149. void OnOpenDebug(InputAction.CallbackContext context);
  150. }
  151. }
  152. }