//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.19.0 // from Assets/Settings/Project M Input.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/Settings/Project M Input.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 @ProjectMInput: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @ProjectMInput() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""Project M Input"", ""maps"": [ { ""name"": ""Gameplay"", ""id"": ""69723709-3120-49dd-bbf0-91ac92ad8582"", ""actions"": [ { ""name"": ""Move"", ""type"": ""Value"", ""id"": ""2982f936-538e-4a37-a100-8eb7a2a88e4b"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Aim"", ""type"": ""Value"", ""id"": ""a1b2c3d4-0a1m-4a1m-8a1m-000000000001"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Fire"", ""type"": ""Button"", ""id"": ""a1b2c3d4-0f1r-4f1r-8f1r-000000000002"", ""expectedControlType"": ""Button"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false } ], ""bindings"": [ { ""name"": """", ""id"": ""c3b1e700-eea3-426c-863d-36403d537af3"", ""path"": ""/leftStick"", ""interactions"": """", ""processors"": """", ""groups"": "";Gamepad"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": ""WASD"", ""id"": ""cc5f8773-3f87-4e89-926e-2835221cc71b"", ""path"": ""Dpad"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""cc98fd24-5e37-4b4a-8fdc-9a1c21bc1e09"", ""path"": ""/w"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""up"", ""id"": ""59f74329-7d63-4bf5-b3bc-3af75462894f"", ""path"": ""/upArrow"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""624a58a3-f4ec-479f-8e1b-3b54ffaa7d8e"", ""path"": ""/s"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""2d3501d8-5759-4d58-a909-a5ef3aa51842"", ""path"": ""/downArrow"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""14dbcdaf-402d-496b-9798-54b770c4a826"", ""path"": ""/a"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""2f4809ce-93a5-44f7-802d-6ac61f1e03e2"", ""path"": ""/leftArrow"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""de79a6ae-cf9d-4536-b851-b630e3344d04"", ""path"": ""/d"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""5bfaeff9-d16a-4fca-b43d-1d6d6b442bc8"", ""path"": ""/rightArrow"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""401d3950-45d9-4839-b287-14c2b3902c67"", ""path"": ""/{Primary2DAxis}"", ""interactions"": """", ""processors"": """", ""groups"": ""XR"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""b23bd67c-a1c3-44a5-a73b-c824416534fa"", ""path"": ""/stick"", ""interactions"": """", ""processors"": """", ""groups"": ""Joystick"", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""d1e2f3a4-aim0-4001-8001-000000000011"", ""path"": ""/rightStick"", ""interactions"": """", ""processors"": """", ""groups"": "";Gamepad"", ""action"": ""Aim"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""d1e2f3a4-fir0-4001-8001-000000000021"", ""path"": ""/rightTrigger"", ""interactions"": """", ""processors"": """", ""groups"": "";Gamepad"", ""action"": ""Fire"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""d1e2f3a4-fir0-4001-8001-000000000022"", ""path"": ""/leftButton"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Fire"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""d1e2f3a4-fir0-4001-8001-000000000023"", ""path"": ""/space"", ""interactions"": """", ""processors"": """", ""groups"": "";Keyboard&Mouse"", ""action"": ""Fire"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // Gameplay m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true); m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true); m_Gameplay_Aim = m_Gameplay.FindAction("Aim", throwIfNotFound: true); m_Gameplay_Fire = m_Gameplay.FindAction("Fire", throwIfNotFound: true); } ~@ProjectMInput() { UnityEngine.Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, ProjectMInput.Gameplay.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); } // Gameplay private readonly InputActionMap m_Gameplay; private List m_GameplayActionsCallbackInterfaces = new List(); private readonly InputAction m_Gameplay_Move; private readonly InputAction m_Gameplay_Aim; private readonly InputAction m_Gameplay_Fire; /// /// Provides access to input actions defined in input action map "Gameplay". /// public struct GameplayActions { private @ProjectMInput m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public GameplayActions(@ProjectMInput wrapper) { m_Wrapper = wrapper; } /// /// Provides access to the underlying input action "Gameplay/Move". /// public InputAction @Move => m_Wrapper.m_Gameplay_Move; /// /// Provides access to the underlying input action "Gameplay/Aim". /// public InputAction @Aim => m_Wrapper.m_Gameplay_Aim; /// /// Provides access to the underlying input action "Gameplay/Fire". /// public InputAction @Fire => m_Wrapper.m_Gameplay_Fire; /// /// Provides access to the underlying input action map instance. /// public InputActionMap Get() { return m_Wrapper.m_Gameplay; } /// 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(GameplayActions 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(IGameplayActions instance) { if (instance == null || m_Wrapper.m_GameplayActionsCallbackInterfaces.Contains(instance)) return; m_Wrapper.m_GameplayActionsCallbackInterfaces.Add(instance); @Move.started += instance.OnMove; @Move.performed += instance.OnMove; @Move.canceled += instance.OnMove; @Aim.started += instance.OnAim; @Aim.performed += instance.OnAim; @Aim.canceled += instance.OnAim; @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(IGameplayActions instance) { @Move.started -= instance.OnMove; @Move.performed -= instance.OnMove; @Move.canceled -= instance.OnMove; @Aim.started -= instance.OnAim; @Aim.performed -= instance.OnAim; @Aim.canceled -= instance.OnAim; @Fire.started -= instance.OnFire; @Fire.performed -= instance.OnFire; @Fire.canceled -= instance.OnFire; } /// /// Unregisters and unregisters all input action callbacks via . /// /// public void RemoveCallbacks(IGameplayActions instance) { if (m_Wrapper.m_GameplayActionsCallbackInterfaces.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(IGameplayActions instance) { foreach (var item in m_Wrapper.m_GameplayActionsCallbackInterfaces) UnregisterCallbacks(item); m_Wrapper.m_GameplayActionsCallbackInterfaces.Clear(); AddCallbacks(instance); } } /// /// Provides a new instance referencing this action map. /// public GameplayActions @Gameplay => new GameplayActions(this); /// /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Gameplay" which allows adding and removing callbacks. /// /// /// public interface IGameplayActions { /// /// Method invoked when associated input action "Move" is either , or . /// /// /// /// void OnMove(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Aim" is either , or . /// /// /// /// void OnAim(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Fire" is either , or . /// /// /// /// void OnFire(InputAction.CallbackContext context); } }