//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.20.0 // from Assets/_Project/Controlling/PlayerControls.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/_Project/Controlling/PlayerControls.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 @PlayerControls: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @PlayerControls() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""PlayerControls"", ""maps"": [ { ""name"": ""Player"", ""id"": ""bdd3dc69-16cf-4437-b29f-7e6b248b95be"", ""actions"": [ { ""name"": ""Move"", ""type"": ""Value"", ""id"": ""e210b79a-7920-4b30-9d6e-0a7d18470f05"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true, ""priority"": 0 }, { ""name"": ""Jump"", ""type"": ""Button"", ""id"": ""296d308d-8ea2-4fad-a0c0-190e22020667"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false, ""priority"": 0 }, { ""name"": ""Sprint"", ""type"": ""Button"", ""id"": ""a4f29f57-3261-4f9f-9b08-6921474c5626"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false, ""priority"": 0 }, { ""name"": ""Crouch"", ""type"": ""Button"", ""id"": ""25aa0afc-6100-4b26-8cc6-443ab493e339"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false, ""priority"": 0 }, { ""name"": ""Look"", ""type"": ""Value"", ""id"": ""0fcdf59f-f75a-46b3-942a-3e058f7e938b"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true, ""priority"": 0 }, { ""name"": ""EnterMenu"", ""type"": ""Button"", ""id"": ""cd12ecf0-ae75-4423-9155-904f79e0dee6"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false, ""priority"": 0 }, { ""name"": ""Attack"", ""type"": ""Button"", ""id"": ""68813cd9-75a1-4031-b390-a01395eef173"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false, ""priority"": 0 } ], ""bindings"": [ { ""name"": ""2D Vector"", ""id"": ""9e29a53b-5753-4edd-b266-8afe51b14035"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""12feddc2-0116-44de-9bb7-f23a0ce1bbfc"", ""path"": ""/w"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""1da7ff83-8c83-4b2e-a853-1eef7ef9cb59"", ""path"": ""/s"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""059c6634-9295-423b-a3c0-5e81610d9b2f"", ""path"": ""/a"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""2ccfc7c1-94ff-4408-bd32-60242e3f478b"", ""path"": ""/d"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""bfb1b5f8-7323-4c23-975a-18b63b6b35b8"", ""path"": ""/space"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Jump"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""dcae16bd-c94f-4e41-b266-c4cd5fdb6ace"", ""path"": ""/leftShift"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Sprint"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""56032c6c-f03b-47c1-bf9c-d397101b947a"", ""path"": ""/c"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Crouch"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""4431a50a-5d2c-4147-8dd2-2c28b8d4aee1"", ""path"": ""/delta"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Look"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""a112934a-cd8d-4927-bae9-6fb0b9601646"", ""path"": ""/escape"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""EnterMenu"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""7b7eeb94-7e87-4db8-a3e0-0b75c77293b9"", ""path"": ""/leftButton"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Attack"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // Player m_Player = asset.FindActionMap("Player", throwIfNotFound: true); m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true); m_Player_Sprint = m_Player.FindAction("Sprint", throwIfNotFound: true); m_Player_Crouch = m_Player.FindAction("Crouch", throwIfNotFound: true); m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true); m_Player_EnterMenu = m_Player.FindAction("EnterMenu", throwIfNotFound: true); m_Player_Attack = m_Player.FindAction("Attack", throwIfNotFound: true); } ~@PlayerControls() { UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, PlayerControls.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_Jump; private readonly InputAction m_Player_Sprint; private readonly InputAction m_Player_Crouch; private readonly InputAction m_Player_Look; private readonly InputAction m_Player_EnterMenu; private readonly InputAction m_Player_Attack; /// /// Provides access to input actions defined in input action map "Player". /// public struct PlayerActions { private @PlayerControls m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public PlayerActions(@PlayerControls 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/Jump". /// public InputAction @Jump => m_Wrapper.m_Player_Jump; /// /// 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/Crouch". /// public InputAction @Crouch => m_Wrapper.m_Player_Crouch; /// /// Provides access to the underlying input action "Player/Look". /// public InputAction @Look => m_Wrapper.m_Player_Look; /// /// Provides access to the underlying input action "Player/EnterMenu". /// public InputAction @EnterMenu => m_Wrapper.m_Player_EnterMenu; /// /// Provides access to the underlying input action "Player/Attack". /// public InputAction @Attack => m_Wrapper.m_Player_Attack; /// /// 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; @Jump.started += instance.OnJump; @Jump.performed += instance.OnJump; @Jump.canceled += instance.OnJump; @Sprint.started += instance.OnSprint; @Sprint.performed += instance.OnSprint; @Sprint.canceled += instance.OnSprint; @Crouch.started += instance.OnCrouch; @Crouch.performed += instance.OnCrouch; @Crouch.canceled += instance.OnCrouch; @Look.started += instance.OnLook; @Look.performed += instance.OnLook; @Look.canceled += instance.OnLook; @EnterMenu.started += instance.OnEnterMenu; @EnterMenu.performed += instance.OnEnterMenu; @EnterMenu.canceled += instance.OnEnterMenu; @Attack.started += instance.OnAttack; @Attack.performed += instance.OnAttack; @Attack.canceled += instance.OnAttack; } /// /// 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; @Jump.started -= instance.OnJump; @Jump.performed -= instance.OnJump; @Jump.canceled -= instance.OnJump; @Sprint.started -= instance.OnSprint; @Sprint.performed -= instance.OnSprint; @Sprint.canceled -= instance.OnSprint; @Crouch.started -= instance.OnCrouch; @Crouch.performed -= instance.OnCrouch; @Crouch.canceled -= instance.OnCrouch; @Look.started -= instance.OnLook; @Look.performed -= instance.OnLook; @Look.canceled -= instance.OnLook; @EnterMenu.started -= instance.OnEnterMenu; @EnterMenu.performed -= instance.OnEnterMenu; @EnterMenu.canceled -= instance.OnEnterMenu; @Attack.started -= instance.OnAttack; @Attack.performed -= instance.OnAttack; @Attack.canceled -= instance.OnAttack; } /// /// 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 "Jump" is either , or . /// /// /// /// void OnJump(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Sprint" is either , or . /// /// /// /// void OnSprint(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Crouch" is either , or . /// /// /// /// void OnCrouch(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Look" is either , or . /// /// /// /// void OnLook(InputAction.CallbackContext context); /// /// Method invoked when associated input action "EnterMenu" is either , or . /// /// /// /// void OnEnterMenu(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Attack" is either , or . /// /// /// /// void OnAttack(InputAction.CallbackContext context); } }