//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.19.0 // from Assets/Scripts/InputActions.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; /// /// Provides programmatic access to , , and instances defined in asset "Assets/Scripts/InputActions.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 @InputActions: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @InputActions() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""InputActions"", ""maps"": [ { ""name"": ""Player"", ""id"": ""a9631db6-afdf-47e4-a8a3-d63ab06f361c"", ""actions"": [ { ""name"": ""Movement"", ""type"": ""Value"", ""id"": ""bc1a3c6a-5454-4e22-a4c4-e507bd5ef719"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Fire"", ""type"": ""Button"", ""id"": ""15426cef-f42f-45e2-96a3-be5ccf4f7c77"", ""expectedControlType"": ""Button"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false } ], ""bindings"": [ { ""name"": ""2D Vector"", ""id"": ""ec20865d-29b5-4923-a398-026e3b6a452a"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""ec9e58f5-3e87-4b8e-98a0-d6f57dee5a62"", ""path"": ""/upArrow"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""6833e932-d60c-49ad-84eb-2f63e3847d53"", ""path"": ""/downArrow"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""aee692a9-6d5f-4fea-b555-8dc6c147efbd"", ""path"": ""/leftArrow"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""ba2ffdd7-4da3-4b20-9b49-14448c0a8a15"", ""path"": ""/rightArrow"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""2D Vector"", ""id"": ""2bc3f525-a5a8-4d0f-a679-5b0d8dcff168"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""a7ed1fe9-4819-4055-840d-284172ef0cba"", ""path"": ""/leftStick/up"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""f1b7a29e-55b7-4a22-b2db-fceee993e456"", ""path"": ""/leftStick/down"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""e1be144e-9344-47d0-ad6a-4160bb893bcb"", ""path"": ""/leftStick/left"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""150c31e4-d3d8-4d14-9f07-3185561a86ba"", ""path"": ""/leftStick/right"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Movement"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""0b8928e8-bac0-49e9-b1bf-c272e35f6f52"", ""path"": ""/space"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Fire"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""14e658e7-227f-47f6-94ad-fc988b635cb1"", ""path"": ""/buttonSouth"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Fire"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // Player m_Player = asset.FindActionMap("Player", throwIfNotFound: true); m_Player_Movement = m_Player.FindAction("Movement", throwIfNotFound: true); m_Player_Fire = m_Player.FindAction("Fire", throwIfNotFound: true); } ~@InputActions() { UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, InputActions.Player.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_Movement; private readonly InputAction m_Player_Fire; /// /// Provides access to input actions defined in input action map "Player". /// public struct PlayerActions { private @InputActions m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public PlayerActions(@InputActions wrapper) { m_Wrapper = wrapper; } /// /// Provides access to the underlying input action "Player/Movement". /// public InputAction @Movement => m_Wrapper.m_Player_Movement; /// /// Provides access to the underlying input action "Player/Fire". /// public InputAction @Fire => m_Wrapper.m_Player_Fire; /// /// 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); @Movement.started += instance.OnMovement; @Movement.performed += instance.OnMovement; @Movement.canceled += instance.OnMovement; @Fire.started += instance.OnFire; @Fire.performed += instance.OnFire; @Fire.canceled += instance.OnFire; } /// /// 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) { @Movement.started -= instance.OnMovement; @Movement.performed -= instance.OnMovement; @Movement.canceled -= instance.OnMovement; @Fire.started -= instance.OnFire; @Fire.performed -= instance.OnFire; @Fire.canceled -= instance.OnFire; } /// /// 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); /// /// 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 "Movement" is either , or . /// /// /// /// void OnMovement(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Fire" is either , or . /// /// /// /// void OnFire(InputAction.CallbackContext context); } }