//------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator // version 1.18.0 // from Assets/main/Scripts/PlayerInputActions.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/main/Scripts/PlayerInputActions.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 @PlayerInputActions: IInputActionCollection2, IDisposable { /// /// Provides access to the underlying asset instance. /// public InputActionAsset asset { get; } /// /// Constructs a new instance. /// public @PlayerInputActions() { asset = InputActionAsset.FromJson(@"{ ""version"": 1, ""name"": ""PlayerInputActions"", ""maps"": [ { ""name"": ""FlyCam"", ""id"": ""fa114067-1244-48b1-8c67-013cde0369b7"", ""actions"": [ { ""name"": ""Move"", ""type"": ""Value"", ""id"": ""ec681502-bf00-4de3-a0ec-191fef79e172"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""Look"", ""type"": ""Value"", ""id"": ""78dc3f02-5358-4e8d-8b18-e934e8b84c5a"", ""expectedControlType"": ""Vector2"", ""processors"": """", ""interactions"": """", ""initialStateCheck"": true }, { ""name"": ""MoveUp"", ""type"": ""Button"", ""id"": ""f56a3c8f-2392-4bc5-aa7d-f826c86d2038"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""MoveDown"", ""type"": ""Button"", ""id"": ""6c8a85c8-9390-434e-8a29-ed3ab9bd0762"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""Boost"", ""type"": ""Button"", ""id"": ""3c0b2554-ace8-4057-9c47-f37b469d62f9"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false }, { ""name"": ""LeftClickHold"", ""type"": ""Button"", ""id"": ""95baab95-de5e-4ebe-908f-e275adb7d686"", ""expectedControlType"": """", ""processors"": """", ""interactions"": """", ""initialStateCheck"": false } ], ""bindings"": [ { ""name"": ""WASD"", ""id"": ""5fcf3001-3a7b-4dcb-a800-21e11f78ef44"", ""path"": ""2DVector"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""up"", ""id"": ""fac5cd22-66c8-43e5-81eb-7aed79106247"", ""path"": ""/w"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""down"", ""id"": ""3d0c5f29-fd8b-41a9-a65b-256106d09521"", ""path"": ""/s"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""left"", ""id"": ""d8f9cffd-341c-4b07-ac5d-dcce7163f86f"", ""path"": ""/a"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""right"", ""id"": ""139dceb9-129b-40c4-b755-6ed97b96bfa4"", ""path"": ""/d"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Move"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": """", ""id"": ""43be19f1-4443-4af9-8990-6b41ec2e9d54"", ""path"": ""/delta"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Look"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""fae0ec58-45c1-4ed1-b4af-e3e77f36c69a"", ""path"": ""/e"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""MoveUp"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""04f8b723-631d-4927-b9e6-409570a95796"", ""path"": ""/q"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""MoveDown"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""4d58c389-ad15-43c0-b6e0-2f50ea318061"", ""path"": ""/leftShift"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""Boost"", ""isComposite"": false, ""isPartOfComposite"": false }, { ""name"": """", ""id"": ""0ee748a2-b4b2-4794-9219-fdded6cd9728"", ""path"": ""/leftButton"", ""interactions"": """", ""processors"": """", ""groups"": """", ""action"": ""LeftClickHold"", ""isComposite"": false, ""isPartOfComposite"": false } ] } ], ""controlSchemes"": [] }"); // FlyCam m_FlyCam = asset.FindActionMap("FlyCam", throwIfNotFound: true); m_FlyCam_Move = m_FlyCam.FindAction("Move", throwIfNotFound: true); m_FlyCam_Look = m_FlyCam.FindAction("Look", throwIfNotFound: true); m_FlyCam_MoveUp = m_FlyCam.FindAction("MoveUp", throwIfNotFound: true); m_FlyCam_MoveDown = m_FlyCam.FindAction("MoveDown", throwIfNotFound: true); m_FlyCam_Boost = m_FlyCam.FindAction("Boost", throwIfNotFound: true); m_FlyCam_LeftClickHold = m_FlyCam.FindAction("LeftClickHold", throwIfNotFound: true); } ~@PlayerInputActions() { UnityEngine.Debug.Assert(!m_FlyCam.enabled, "This will cause a leak and performance issues, PlayerInputActions.FlyCam.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); } // FlyCam private readonly InputActionMap m_FlyCam; private List m_FlyCamActionsCallbackInterfaces = new List(); private readonly InputAction m_FlyCam_Move; private readonly InputAction m_FlyCam_Look; private readonly InputAction m_FlyCam_MoveUp; private readonly InputAction m_FlyCam_MoveDown; private readonly InputAction m_FlyCam_Boost; private readonly InputAction m_FlyCam_LeftClickHold; /// /// Provides access to input actions defined in input action map "FlyCam". /// public struct FlyCamActions { private @PlayerInputActions m_Wrapper; /// /// Construct a new instance of the input action map wrapper class. /// public FlyCamActions(@PlayerInputActions wrapper) { m_Wrapper = wrapper; } /// /// Provides access to the underlying input action "FlyCam/Move". /// public InputAction @Move => m_Wrapper.m_FlyCam_Move; /// /// Provides access to the underlying input action "FlyCam/Look". /// public InputAction @Look => m_Wrapper.m_FlyCam_Look; /// /// Provides access to the underlying input action "FlyCam/MoveUp". /// public InputAction @MoveUp => m_Wrapper.m_FlyCam_MoveUp; /// /// Provides access to the underlying input action "FlyCam/MoveDown". /// public InputAction @MoveDown => m_Wrapper.m_FlyCam_MoveDown; /// /// Provides access to the underlying input action "FlyCam/Boost". /// public InputAction @Boost => m_Wrapper.m_FlyCam_Boost; /// /// Provides access to the underlying input action "FlyCam/LeftClickHold". /// public InputAction @LeftClickHold => m_Wrapper.m_FlyCam_LeftClickHold; /// /// Provides access to the underlying input action map instance. /// public InputActionMap Get() { return m_Wrapper.m_FlyCam; } /// 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(FlyCamActions 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(IFlyCamActions instance) { if (instance == null || m_Wrapper.m_FlyCamActionsCallbackInterfaces.Contains(instance)) return; m_Wrapper.m_FlyCamActionsCallbackInterfaces.Add(instance); @Move.started += instance.OnMove; @Move.performed += instance.OnMove; @Move.canceled += instance.OnMove; @Look.started += instance.OnLook; @Look.performed += instance.OnLook; @Look.canceled += instance.OnLook; @MoveUp.started += instance.OnMoveUp; @MoveUp.performed += instance.OnMoveUp; @MoveUp.canceled += instance.OnMoveUp; @MoveDown.started += instance.OnMoveDown; @MoveDown.performed += instance.OnMoveDown; @MoveDown.canceled += instance.OnMoveDown; @Boost.started += instance.OnBoost; @Boost.performed += instance.OnBoost; @Boost.canceled += instance.OnBoost; @LeftClickHold.started += instance.OnLeftClickHold; @LeftClickHold.performed += instance.OnLeftClickHold; @LeftClickHold.canceled += instance.OnLeftClickHold; } /// /// 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(IFlyCamActions instance) { @Move.started -= instance.OnMove; @Move.performed -= instance.OnMove; @Move.canceled -= instance.OnMove; @Look.started -= instance.OnLook; @Look.performed -= instance.OnLook; @Look.canceled -= instance.OnLook; @MoveUp.started -= instance.OnMoveUp; @MoveUp.performed -= instance.OnMoveUp; @MoveUp.canceled -= instance.OnMoveUp; @MoveDown.started -= instance.OnMoveDown; @MoveDown.performed -= instance.OnMoveDown; @MoveDown.canceled -= instance.OnMoveDown; @Boost.started -= instance.OnBoost; @Boost.performed -= instance.OnBoost; @Boost.canceled -= instance.OnBoost; @LeftClickHold.started -= instance.OnLeftClickHold; @LeftClickHold.performed -= instance.OnLeftClickHold; @LeftClickHold.canceled -= instance.OnLeftClickHold; } /// /// Unregisters and unregisters all input action callbacks via . /// /// public void RemoveCallbacks(IFlyCamActions instance) { if (m_Wrapper.m_FlyCamActionsCallbackInterfaces.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(IFlyCamActions instance) { foreach (var item in m_Wrapper.m_FlyCamActionsCallbackInterfaces) UnregisterCallbacks(item); m_Wrapper.m_FlyCamActionsCallbackInterfaces.Clear(); AddCallbacks(instance); } } /// /// Provides a new instance referencing this action map. /// public FlyCamActions @FlyCam => new FlyCamActions(this); /// /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "FlyCam" which allows adding and removing callbacks. /// /// /// public interface IFlyCamActions { /// /// Method invoked when associated input action "Move" is either , or . /// /// /// /// void OnMove(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Look" is either , or . /// /// /// /// void OnLook(InputAction.CallbackContext context); /// /// Method invoked when associated input action "MoveUp" is either , or . /// /// /// /// void OnMoveUp(InputAction.CallbackContext context); /// /// Method invoked when associated input action "MoveDown" is either , or . /// /// /// /// void OnMoveDown(InputAction.CallbackContext context); /// /// Method invoked when associated input action "Boost" is either , or . /// /// /// /// void OnBoost(InputAction.CallbackContext context); /// /// Method invoked when associated input action "LeftClickHold" is either , or . /// /// /// /// void OnLeftClickHold(InputAction.CallbackContext context); } }