//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.19.0 // from Assets/New Lowpoly Models/Input Actions/New Actions.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/New Lowpoly Models/Input Actions/New Actions.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 @NewActions: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @NewActions() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""New Actions"", ""maps"": [ { ""name"": ""Player"", ""id"": ""cef45a72-fa7b-4a2a-8dde-ca288c5dea73"", ""actions"": [ { ""name"": ""Move"", ""type"": ""Value"", ""id"": ""f6bb4f24-c143-439e-9be3-e5f349336f05"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Sprint"", ""type"": ""Button"", ""id"": ""6976591c-106e-4c65-a03d-d8b3b854b6ef"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack1"", ""type"": ""Button"", ""id"": ""85664ae7-6a4b-4537-a720-fcc455a8a611"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack2"", ""type"": ""Button"", ""id"": ""120d349e-065b-4423-aba9-b3502023c9bd"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack3"", ""type"": ""Button"", ""id"": ""f527a4af-371b-49fa-aae4-07e9a92608e9"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack4"", ""type"": ""Button"", ""id"": ""1bb45d7f-14f3-4966-9c9d-fa6e2e16c590"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack5"", ""type"": ""Button"", ""id"": ""1234f1ff-e084-4c0e-a59c-2ba4722cdb9e"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Attack6"", ""type"": ""Button"", ""id"": ""8c277da3-2403-4362-b088-9bd3a7029c3f"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false } ], ""bindings"": [ { ""name"": ""2D Vector"", ""id"": ""80148eb7-ec32-4f1f-bf8d-a6da9a1be58f"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""82b31557-4d35-462a-83e4-c194708f7ca8"", ""path"": ""/w"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""0ce2b931-1201-47a8-a33c-af2b395d015e"", ""path"": ""/s"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""2d33a65c-7154-4057-9ac0-b9ecc5c00307"", ""path"": ""/a"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""54e3971b-5f68-40fa-836e-3fb356e30056"", ""path"": ""/d"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""bb9d3d30-d252-4009-a568-806c16385fca"", ""path"": ""/leftStick"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""62db4cd4-2d95-47cb-846a-9a48a227474b"", ""path"": ""/leftShift"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Sprint"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""63a88bf8-950d-4792-b037-5bce58442781"", ""path"": ""/1"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack1"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""82c49bc0-b93b-4df3-b99b-ccbe87a57575"", ""path"": ""/2"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack2"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""f0f27749-d495-46ee-a659-6f05502a7bc1"", ""path"": ""/3"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack3"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""b22ce34f-cf5c-457e-86b4-1d68d2070356"", ""path"": ""/4"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack4"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""b7264b16-8fd0-4c24-817c-d7689ed1ea06"", ""path"": ""/5"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack5"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""298c590c-31bd-4e4a-b871-dc79c4c0a3aa"", ""path"": ""/6"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack6"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // Player m_Player = asset.FindActionMap("Player", throwIfNotFound: true); m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); m_Player_Sprint = m_Player.FindAction("Sprint", throwIfNotFound: true); m_Player_Attack1 = m_Player.FindAction("Attack1", throwIfNotFound: true); m_Player_Attack2 = m_Player.FindAction("Attack2", throwIfNotFound: true); m_Player_Attack3 = m_Player.FindAction("Attack3", throwIfNotFound: true); m_Player_Attack4 = m_Player.FindAction("Attack4", throwIfNotFound: true); m_Player_Attack5 = m_Player.FindAction("Attack5", throwIfNotFound: true); m_Player_Attack6 = m_Player.FindAction("Attack6", throwIfNotFound: true); } ~@NewActions() { UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, NewActions.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_Move; private readonly InputAction m_Player_Sprint; private readonly InputAction m_Player_Attack1; private readonly InputAction m_Player_Attack2; private readonly InputAction m_Player_Attack3; private readonly InputAction m_Player_Attack4; private readonly InputAction m_Player_Attack5; private readonly InputAction m_Player_Attack6; /// /// Provides access to input actions defined in input action map "Player". /// public struct PlayerActions { private @NewActions m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public PlayerActions(@NewActions 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/Sprint". /// public InputAction @Sprint => m_Wrapper.m_Player_Sprint; /// /// Provides access to the underlying input action "Player/Attack1". /// public InputAction @Attack1 => m_Wrapper.m_Player_Attack1; /// /// Provides access to the underlying input action "Player/Attack2". /// public InputAction @Attack2 => m_Wrapper.m_Player_Attack2; /// /// Provides access to the underlying input action "Player/Attack3". /// public InputAction @Attack3 => m_Wrapper.m_Player_Attack3; /// /// Provides access to the underlying input action "Player/Attack4". /// public InputAction @Attack4 => m_Wrapper.m_Player_Attack4; /// /// Provides access to the underlying input action "Player/Attack5". /// public InputAction @Attack5 => m_Wrapper.m_Player_Attack5; /// /// Provides access to the underlying input action "Player/Attack6". /// public InputAction @Attack6 => m_Wrapper.m_Player_Attack6; /// /// 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; @Sprint.started += instance.OnSprint; @Sprint.performed += instance.OnSprint; @Sprint.canceled += instance.OnSprint; @Attack1.started += instance.OnAttack1; @Attack1.performed += instance.OnAttack1; @Attack1.canceled += instance.OnAttack1; @Attack2.started += instance.OnAttack2; @Attack2.performed += instance.OnAttack2; @Attack2.canceled += instance.OnAttack2; @Attack3.started += instance.OnAttack3; @Attack3.performed += instance.OnAttack3; @Attack3.canceled += instance.OnAttack3; @Attack4.started += instance.OnAttack4; @Attack4.performed += instance.OnAttack4; @Attack4.canceled += instance.OnAttack4; @Attack5.started += instance.OnAttack5; @Attack5.performed += instance.OnAttack5; @Attack5.canceled += instance.OnAttack5; @Attack6.started += instance.OnAttack6; @Attack6.performed += instance.OnAttack6; @Attack6.canceled += instance.OnAttack6; } /// /// 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; @Sprint.started -= instance.OnSprint; @Sprint.performed -= instance.OnSprint; @Sprint.canceled -= instance.OnSprint; @Attack1.started -= instance.OnAttack1; @Attack1.performed -= instance.OnAttack1; @Attack1.canceled -= instance.OnAttack1; @Attack2.started -= instance.OnAttack2; @Attack2.performed -= instance.OnAttack2; @Attack2.canceled -= instance.OnAttack2; @Attack3.started -= instance.OnAttack3; @Attack3.performed -= instance.OnAttack3; @Attack3.canceled -= instance.OnAttack3; @Attack4.started -= instance.OnAttack4; @Attack4.performed -= instance.OnAttack4; @Attack4.canceled -= instance.OnAttack4; @Attack5.started -= instance.OnAttack5; @Attack5.performed -= instance.OnAttack5; @Attack5.canceled -= instance.OnAttack5; @Attack6.started -= instance.OnAttack6; @Attack6.performed -= instance.OnAttack6; @Attack6.canceled -= instance.OnAttack6; } /// /// 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 "Move" is either , or . /// /// /// /// void OnMove(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Sprint" is either , or . /// /// /// /// void OnSprint(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack1" is either , or . /// /// /// /// void OnAttack1(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack2" is either , or . /// /// /// /// void OnAttack2(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack3" is either , or . /// /// /// /// void OnAttack3(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack4" is either , or . /// /// /// /// void OnAttack4(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack5" is either , or . /// /// /// /// void OnAttack5(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack6" is either , or . /// /// /// /// void OnAttack6(InputAction.CallbackContext context); } }