//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.14.2 // from Assets/GameInput.inputactions // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System; using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; namespace MyGame { /// /// Provides programmatic access to , , and instances defined in asset "Assets/GameInput.inputactions". /// /// /// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified. /// /// /// /// using namespace UnityEngine; /// using UnityEngine.InputSystem; /// /// // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface. /// public class Example : MonoBehaviour, MyActions.IPlayerActions /// { /// private MyActions_Actions m_Actions; // Source code representation of asset. /// private MyActions_Actions.PlayerActions m_Player; // Source code representation of action map. /// /// void Awake() /// { /// m_Actions = new MyActions_Actions(); // Create asset object. /// m_Player = m_Actions.Player; // Extract action map object. /// m_Player.AddCallbacks(this); // Register callback interface IPlayerActions. /// } /// /// void OnDestroy() /// { /// m_Actions.Dispose(); // Destroy asset object. /// } /// /// void OnEnable() /// { /// m_Player.Enable(); // Enable all actions within map. /// } /// /// void OnDisable() /// { /// m_Player.Disable(); // Disable all actions within map. /// } /// /// #region Interface implementation of MyActions.IPlayerActions /// /// // Invoked when "Move" action is either started, performed or canceled. /// public void OnMove(InputAction.CallbackContext context) /// { /// Debug.Log($"OnMove: {context.ReadValue<Vector2>()}"); /// } /// /// // Invoked when "Attack" action is either started, performed or canceled. /// public void OnAttack(InputAction.CallbackContext context) /// { /// Debug.Log($"OnAttack: {context.ReadValue<float>()}"); /// } /// /// #endregion /// } /// /// public partial class @GameInput: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @GameInput() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""GameInput"", ""maps"": [ { ""name"": ""Player"", ""id"": ""c5f5140a-6c55-4687-96a4-719486fa0120"", ""actions"": [ { ""name"": ""Move"", ""type"": ""Value"", ""id"": ""fb1fb8b1-952e-48c3-be0a-6d99ec015457"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Attack"", ""type"": ""Button"", ""id"": ""831072cf-98c4-4730-a288-9c075f52bb96"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Sprint"", ""type"": ""Button"", ""id"": ""cc71cfb6-6718-47bf-882c-a2d7e791dd9b"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Pause"", ""type"": ""Button"", ""id"": ""9e55caaf-1024-4d37-b2f0-45bae8f6dd5e"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Look"", ""type"": ""Value"", ""id"": ""06b6d68e-ea07-4398-8668-e03d07df36fa"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true } ], ""bindings"": [ { ""name"": ""Keyboard"", ""id"": ""d35aa84d-a154-42fc-9b6a-b17427aea516"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""500909f2-5b69-4c9d-bbe6-deb4ca99b604"", ""path"": ""/w"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""9d68f93c-4455-4784-86fa-f970fadc15bb"", ""path"": ""/s"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""db0b0c0f-a4fb-44c0-b7ce-7b8655fb3b15"", ""path"": ""/a"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""eb8e3800-b72e-42b4-8986-0848dfbb5066"", ""path"": ""/d"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""50f1992d-26b1-4721-8450-dc8241a330bd"", ""path"": ""/leftButton"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""1557a5e4-54a4-4be9-881d-7443844fa741"", ""path"": ""/leftShift"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Sprint"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""393d9aae-b6a5-49b8-827a-e1b91e5fe989"", ""path"": ""/rightShift"", ""interactions"": ""Tap(duration=0.1,pressPoint=0.1)"", ""processors"": """", ""groups"": """", ""action"": ""Sprint"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""250aad9c-36fb-437f-86a8-5bc2ffd37181"", ""path"": ""/escape"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Pause"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""adfaf544-e692-408b-adc8-2fea8179007f"", ""path"": ""/delta"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Look"", ""isComposite"": false, ""isPartOfComposite"": false } ] }, { ""name"": ""Camera"", ""id"": ""4dee5a7a-23ba-4c02-90f2-cfad11cd034c"", ""actions"": [ { ""name"": ""Change"", ""type"": ""Button"", ""id"": ""9bc77c0b-39aa-4f23-9681-030d9a15587d"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false } ], ""bindings"": [ { ""name"": """", ""id"": ""866a342f-7f1c-4e1d-8113-57b9ca67de2e"", ""path"": ""/rightButton"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Change"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // Player m_Player = asset.FindActionMap("Player", throwIfNotFound: true); m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); m_Player_Attack = m_Player.FindAction("Attack", throwIfNotFound: true); m_Player_Sprint = m_Player.FindAction("Sprint", throwIfNotFound: true); m_Player_Pause = m_Player.FindAction("Pause", throwIfNotFound: true); m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true); // Camera m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true); m_Camera_Change = m_Camera.FindAction("Change", throwIfNotFound: true); } ~@GameInput() { UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, GameInput.Player.Disable() has not been called."); UnityEngine.Debug.Assert(!m_Camera.enabled, "This will cause a leak and performance issues, GameInput.Camera.Disable() has not been called."); } /// /// Destroys this asset and all associated instances. /// public void Dispose() { UnityEngine.Object.Destroy(asset); } /// public InputBinding? bindingMask { get => asset.bindingMask; set => asset.bindingMask = value; } /// public ReadOnlyArray? devices { get => asset.devices; set => asset.devices = value; } /// public ReadOnlyArray controlSchemes => asset.controlSchemes; /// public bool Contains(InputAction action) { return asset.Contains(action); } /// public IEnumerator GetEnumerator() { return asset.GetEnumerator(); } /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } /// public void Enable() { asset.Enable(); } /// public void Disable() { asset.Disable(); } /// public IEnumerable bindings => asset.bindings; /// public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) { return asset.FindAction(actionNameOrId, throwIfNotFound); } /// public int FindBinding(InputBinding bindingMask, out InputAction action) { return asset.FindBinding(bindingMask, out action); } // Player private readonly InputActionMap m_Player; private List m_PlayerActionsCallbackInterfaces = new List(); private readonly InputAction m_Player_Move; private readonly InputAction m_Player_Attack; private readonly InputAction m_Player_Sprint; private readonly InputAction m_Player_Pause; private readonly InputAction m_Player_Look; /// /// Provides access to input actions defined in input action map "Player". /// public struct PlayerActions { private @GameInput m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public PlayerActions(@GameInput wrapper) { m_Wrapper = wrapper; } /// /// Provides access to the underlying input action "Player/Move". /// public InputAction @Move => m_Wrapper.m_Player_Move; /// /// Provides access to the underlying input action "Player/Attack". /// public InputAction @Attack => m_Wrapper.m_Player_Attack; /// /// Provides access to the underlying input action "Player/Sprint". /// public InputAction @Sprint => m_Wrapper.m_Player_Sprint; /// /// Provides access to the underlying input action "Player/Pause". /// public InputAction @Pause => m_Wrapper.m_Player_Pause; /// /// Provides access to the underlying input action "Player/Look". /// public InputAction @Look => m_Wrapper.m_Player_Look; /// /// Provides access to the underlying input action map instance. /// public InputActionMap Get() { return m_Wrapper.m_Player; } /// public void Enable() { Get().Enable(); } /// public void Disable() { Get().Disable(); } /// public bool enabled => Get().enabled; /// /// Implicitly converts an to an instance. /// public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); } /// /// Adds , and callbacks provided via on all input actions contained in this map. /// /// Callback instance. /// /// If is null or have already been added this method does nothing. /// /// public void AddCallbacks(IPlayerActions instance) { if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return; m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance); @Move.started += instance.OnMove; @Move.performed += instance.OnMove; @Move.canceled += instance.OnMove; @Attack.started += instance.OnAttack; @Attack.performed += instance.OnAttack; @Attack.canceled += instance.OnAttack; @Sprint.started += instance.OnSprint; @Sprint.performed += instance.OnSprint; @Sprint.canceled += instance.OnSprint; @Pause.started += instance.OnPause; @Pause.performed += instance.OnPause; @Pause.canceled += instance.OnPause; @Look.started += instance.OnLook; @Look.performed += instance.OnLook; @Look.canceled += instance.OnLook; } /// /// Removes , and callbacks provided via on all input actions contained in this map. /// /// /// Calling this method when have not previously been registered has no side-effects. /// /// private void UnregisterCallbacks(IPlayerActions instance) { @Move.started -= instance.OnMove; @Move.performed -= instance.OnMove; @Move.canceled -= instance.OnMove; @Attack.started -= instance.OnAttack; @Attack.performed -= instance.OnAttack; @Attack.canceled -= instance.OnAttack; @Sprint.started -= instance.OnSprint; @Sprint.performed -= instance.OnSprint; @Sprint.canceled -= instance.OnSprint; @Pause.started -= instance.OnPause; @Pause.performed -= instance.OnPause; @Pause.canceled -= instance.OnPause; @Look.started -= instance.OnLook; @Look.performed -= instance.OnLook; @Look.canceled -= instance.OnLook; } /// /// Unregisters and unregisters all input action callbacks via . /// /// public void RemoveCallbacks(IPlayerActions instance) { if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance)) UnregisterCallbacks(instance); } /// /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . /// /// /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. /// /// /// /// public void SetCallbacks(IPlayerActions instance) { foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces) UnregisterCallbacks(item); m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear(); AddCallbacks(instance); } } /// /// Provides a new instance referencing this action map. /// public PlayerActions @Player => new PlayerActions(this); // Camera private readonly InputActionMap m_Camera; private List m_CameraActionsCallbackInterfaces = new List(); private readonly InputAction m_Camera_Change; /// /// Provides access to input actions defined in input action map "Camera". /// public struct CameraActions { private @GameInput m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public CameraActions(@GameInput wrapper) { m_Wrapper = wrapper; } /// /// Provides access to the underlying input action "Camera/Change". /// public InputAction @Change => m_Wrapper.m_Camera_Change; /// /// Provides access to the underlying input action map instance. /// public InputActionMap Get() { return m_Wrapper.m_Camera; } /// public void Enable() { Get().Enable(); } /// public void Disable() { Get().Disable(); } /// public bool enabled => Get().enabled; /// /// Implicitly converts an to an instance. /// public static implicit operator InputActionMap(CameraActions set) { return set.Get(); } /// /// Adds , and callbacks provided via on all input actions contained in this map. /// /// Callback instance. /// /// If is null or have already been added this method does nothing. /// /// public void AddCallbacks(ICameraActions instance) { if (instance == null || m_Wrapper.m_CameraActionsCallbackInterfaces.Contains(instance)) return; m_Wrapper.m_CameraActionsCallbackInterfaces.Add(instance); @Change.started += instance.OnChange; @Change.performed += instance.OnChange; @Change.canceled += instance.OnChange; } /// /// Removes , and callbacks provided via on all input actions contained in this map. /// /// /// Calling this method when have not previously been registered has no side-effects. /// /// private void UnregisterCallbacks(ICameraActions instance) { @Change.started -= instance.OnChange; @Change.performed -= instance.OnChange; @Change.canceled -= instance.OnChange; } /// /// Unregisters and unregisters all input action callbacks via . /// /// public void RemoveCallbacks(ICameraActions instance) { if (m_Wrapper.m_CameraActionsCallbackInterfaces.Remove(instance)) UnregisterCallbacks(instance); } /// /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . /// /// /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. /// /// /// /// public void SetCallbacks(ICameraActions instance) { foreach (var item in m_Wrapper.m_CameraActionsCallbackInterfaces) UnregisterCallbacks(item); m_Wrapper.m_CameraActionsCallbackInterfaces.Clear(); AddCallbacks(instance); } } /// /// Provides a new instance referencing this action map. /// public CameraActions @Camera => new CameraActions(this); /// /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Player" which allows adding and removing callbacks. /// /// /// public interface IPlayerActions { /// /// Method invoked when associated input action "Move" is either , or . /// /// /// /// void OnMove(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack" is either , or . /// /// /// /// void OnAttack(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Sprint" is either , or . /// /// /// /// void OnSprint(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Pause" is either , or . /// /// /// /// void OnPause(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Look" is either , or . /// /// /// /// void OnLook(InputAction.CallbackContext context); } /// /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Camera" which allows adding and removing callbacks. /// /// /// public interface ICameraActions { /// /// Method invoked when associated input action "Change" is either , or . /// /// /// /// void OnChange(InputAction.CallbackContext context); } } }