Files
gold_dolphin/unity/Assets/Script/Utils/InputActions.cs
2026-06-20 20:17:42 +08:00

802 lines
35 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.12.0
// from Assets/Shader/Setting/InputActions.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
/// <summary>
/// Provides programmatic access to <see cref="InputActionAsset" />, <see cref="InputActionMap" />, <see cref="InputAction" /> and <see cref="InputControlScheme" /> instances defined in asset "Assets/Shader/Setting/InputActions.inputactions".
/// </summary>
/// <remarks>
/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified.
/// </remarks>
/// <example>
/// <code>
/// 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&lt;Vector2&gt;()}");
/// }
///
/// // Invoked when "Attack" action is either started, performed or canceled.
/// public void OnAttack(InputAction.CallbackContext context)
/// {
/// Debug.Log($"OnAttack: {context.ReadValue&lt;float&gt;()}");
/// }
///
/// #endregion
/// }
/// </code>
/// </example>
public partial class @InputActions: IInputActionCollection2, IDisposable
{
/// <summary>
/// Provides access to the underlying asset instance.
/// </summary>
public InputActionAsset asset { get; }
/// <summary>
/// Constructs a new instance.
/// </summary>
public @InputActions()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""InputActions"",
""maps"": [
{
""name"": ""GamePlay"",
""id"": ""ef6d65da-b091-4f70-9e32-99c29000e209"",
""actions"": [
{
""name"": ""Move"",
""type"": ""Value"",
""id"": ""b6a973e9-b6eb-4dad-8a96-553ea339b051"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""Dodge"",
""type"": ""Button"",
""id"": ""d348f7e8-ff62-4c96-87c1-a9e98d57bb2c"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""ComBa_01"",
""type"": ""Button"",
""id"": ""9af8087e-ae18-4038-a763-7a50f8a8bdb0"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""ComBa_02"",
""type"": ""Button"",
""id"": ""3f62d770-4603-4cf6-abef-09404d6f9ae5"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": ""ASWD"",
""id"": ""484f54ae-3627-44d2-a373-6a5b54938842"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""ad2dff40-9527-4d45-9c3e-02332a3f51a3"",
""path"": ""<Keyboard>/w"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""d08e425e-ae6a-4657-af75-09e68b3ed25c"",
""path"": ""<Keyboard>/s"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""4e4b0eaf-ad07-4d76-9daa-935adece5343"",
""path"": ""<Keyboard>/a"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""9b1a005b-e37d-4bb0-819d-0f6b89836782"",
""path"": ""<Keyboard>/d"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""Arrow"",
""id"": ""8d4ef714-11b2-43c3-bbaa-479b49948e0a"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""5b52bfc2-45b5-4de6-915e-b06c67c37f75"",
""path"": ""<Keyboard>/upArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""edf2eecb-163f-43bf-bc30-f960e22f3b26"",
""path"": ""<Keyboard>/downArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""2ce71c6c-6860-4836-82be-bff71a0c46a2"",
""path"": ""<Keyboard>/leftArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""656a945c-89ae-40e7-a605-1e92fbfface0"",
""path"": ""<Keyboard>/rightArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": """",
""id"": ""b48d83b6-1bf3-4ab6-9d2d-20106caf4da6"",
""path"": ""<Gamepad>/leftStick"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""d23564b4-a3cb-4ea3-a16f-89a230fd21b1"",
""path"": ""<Gamepad>/dpad"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""0b5373f5-5766-44bd-ad30-6ecdb7f10507"",
""path"": ""<Keyboard>/leftShift"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Dodge"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""8394600a-cbc2-48f3-98f6-e85b97c6c73a"",
""path"": ""<Gamepad>/buttonWest"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Dodge"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""7b23266c-b664-4e2f-974f-0a39631edfc8"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""ComBa_01"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""b722d7d7-f0b4-48ed-9841-38e1b82bc799"",
""path"": ""<Gamepad>/buttonNorth"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""ComBa_01"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""12f4c305-e962-40b4-a9a7-e5aa3da6c393"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""ComBa_02"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
{
""name"": ""UI"",
""id"": ""c4fb9ed3-1627-423d-846c-d579fa919ec3"",
""actions"": [
{
""name"": ""Stop"",
""type"": ""Button"",
""id"": ""71b6b5b4-6945-48e1-9fd8-6ed8da0a732d"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Bag"",
""type"": ""Button"",
""id"": ""190885c1-dabe-4806-9cab-05bb726a1922"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": """",
""id"": ""b0baa221-5e25-4812-8392-536934b794ff"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""PC"",
""action"": ""Stop"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""907c233f-767d-4184-9500-025c302482d4"",
""path"": ""<Gamepad>/leftStickPress"",
""interactions"": """",
""processors"": """",
""groups"": ""Gamepad"",
""action"": ""Stop"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e4beee93-8dbc-4c17-95b7-1f424ff637ac"",
""path"": ""<Keyboard>/tab"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Bag"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": [
{
""name"": ""PC"",
""bindingGroup"": ""PC"",
""devices"": []
},
{
""name"": ""Gamepad"",
""bindingGroup"": ""Gamepad"",
""devices"": []
}
]
}");
// GamePlay
m_GamePlay = asset.FindActionMap("GamePlay", throwIfNotFound: true);
m_GamePlay_Move = m_GamePlay.FindAction("Move", throwIfNotFound: true);
m_GamePlay_Dodge = m_GamePlay.FindAction("Dodge", throwIfNotFound: true);
m_GamePlay_ComBa_01 = m_GamePlay.FindAction("ComBa_01", throwIfNotFound: true);
m_GamePlay_ComBa_02 = m_GamePlay.FindAction("ComBa_02", throwIfNotFound: true);
// UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
m_UI_Stop = m_UI.FindAction("Stop", throwIfNotFound: true);
m_UI_Bag = m_UI.FindAction("Bag", throwIfNotFound: true);
}
~@InputActions()
{
UnityEngine.Debug.Assert(!m_GamePlay.enabled, "This will cause a leak and performance issues, InputActions.GamePlay.Disable() has not been called.");
UnityEngine.Debug.Assert(!m_UI.enabled, "This will cause a leak and performance issues, InputActions.UI.Disable() has not been called.");
}
/// <summary>
/// Destroys this asset and all associated <see cref="InputAction"/> instances.
/// </summary>
public void Dispose()
{
UnityEngine.Object.Destroy(asset);
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindingMask" />
public InputBinding? bindingMask
{
get => asset.bindingMask;
set => asset.bindingMask = value;
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.devices" />
public ReadOnlyArray<InputDevice>? devices
{
get => asset.devices;
set => asset.devices = value;
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.controlSchemes" />
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Contains(InputAction)" />
public bool Contains(InputAction action)
{
return asset.Contains(action);
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.GetEnumerator()" />
public IEnumerator<InputAction> GetEnumerator()
{
return asset.GetEnumerator();
}
/// <inheritdoc cref="IEnumerable.GetEnumerator()" />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Enable()" />
public void Enable()
{
asset.Enable();
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Disable()" />
public void Disable()
{
asset.Disable();
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindings" />
public IEnumerable<InputBinding> bindings => asset.bindings;
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindAction(string, bool)" />
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
{
return asset.FindAction(actionNameOrId, throwIfNotFound);
}
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindBinding(InputBinding, out InputAction)" />
public int FindBinding(InputBinding bindingMask, out InputAction action)
{
return asset.FindBinding(bindingMask, out action);
}
// GamePlay
private readonly InputActionMap m_GamePlay;
private List<IGamePlayActions> m_GamePlayActionsCallbackInterfaces = new List<IGamePlayActions>();
private readonly InputAction m_GamePlay_Move;
private readonly InputAction m_GamePlay_Dodge;
private readonly InputAction m_GamePlay_ComBa_01;
private readonly InputAction m_GamePlay_ComBa_02;
/// <summary>
/// Provides access to input actions defined in input action map "GamePlay".
/// </summary>
public struct GamePlayActions
{
private @InputActions m_Wrapper;
/// <summary>
/// Construct a new instance of the input action map wrapper class.
/// </summary>
public GamePlayActions(@InputActions wrapper) { m_Wrapper = wrapper; }
/// <summary>
/// Provides access to the underlying input action "GamePlay/Move".
/// </summary>
public InputAction @Move => m_Wrapper.m_GamePlay_Move;
/// <summary>
/// Provides access to the underlying input action "GamePlay/Dodge".
/// </summary>
public InputAction @Dodge => m_Wrapper.m_GamePlay_Dodge;
/// <summary>
/// Provides access to the underlying input action "GamePlay/ComBa_01".
/// </summary>
public InputAction @ComBa_01 => m_Wrapper.m_GamePlay_ComBa_01;
/// <summary>
/// Provides access to the underlying input action "GamePlay/ComBa_02".
/// </summary>
public InputAction @ComBa_02 => m_Wrapper.m_GamePlay_ComBa_02;
/// <summary>
/// Provides access to the underlying input action map instance.
/// </summary>
public InputActionMap Get() { return m_Wrapper.m_GamePlay; }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
public void Enable() { Get().Enable(); }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
public void Disable() { Get().Disable(); }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
public bool enabled => Get().enabled;
/// <summary>
/// Implicitly converts an <see ref="GamePlayActions" /> to an <see ref="InputActionMap" /> instance.
/// </summary>
public static implicit operator InputActionMap(GamePlayActions set) { return set.Get(); }
/// <summary>
/// Adds <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
/// </summary>
/// <param name="instance">Callback instance.</param>
/// <remarks>
/// If <paramref name="instance" /> is <c>null</c> or <paramref name="instance"/> have already been added this method does nothing.
/// </remarks>
/// <seealso cref="GamePlayActions" />
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;
@Dodge.started += instance.OnDodge;
@Dodge.performed += instance.OnDodge;
@Dodge.canceled += instance.OnDodge;
@ComBa_01.started += instance.OnComBa_01;
@ComBa_01.performed += instance.OnComBa_01;
@ComBa_01.canceled += instance.OnComBa_01;
@ComBa_02.started += instance.OnComBa_02;
@ComBa_02.performed += instance.OnComBa_02;
@ComBa_02.canceled += instance.OnComBa_02;
}
/// <summary>
/// Removes <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
/// </summary>
/// <remarks>
/// Calling this method when <paramref name="instance" /> have not previously been registered has no side-effects.
/// </remarks>
/// <seealso cref="GamePlayActions" />
private void UnregisterCallbacks(IGamePlayActions instance)
{
@Move.started -= instance.OnMove;
@Move.performed -= instance.OnMove;
@Move.canceled -= instance.OnMove;
@Dodge.started -= instance.OnDodge;
@Dodge.performed -= instance.OnDodge;
@Dodge.canceled -= instance.OnDodge;
@ComBa_01.started -= instance.OnComBa_01;
@ComBa_01.performed -= instance.OnComBa_01;
@ComBa_01.canceled -= instance.OnComBa_01;
@ComBa_02.started -= instance.OnComBa_02;
@ComBa_02.performed -= instance.OnComBa_02;
@ComBa_02.canceled -= instance.OnComBa_02;
}
/// <summary>
/// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="GamePlayActions.UnregisterCallbacks(IGamePlayActions)" />.
/// </summary>
/// <seealso cref="GamePlayActions.UnregisterCallbacks(IGamePlayActions)" />
public void RemoveCallbacks(IGamePlayActions instance)
{
if (m_Wrapper.m_GamePlayActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
/// <summary>
/// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via <param cref="instance" />.
/// </summary>
/// <remarks>
/// If <paramref name="instance" /> is <c>null</c>, calling this method will only unregister all existing callbacks but not register any new callbacks.
/// </remarks>
/// <seealso cref="GamePlayActions.AddCallbacks(IGamePlayActions)" />
/// <seealso cref="GamePlayActions.RemoveCallbacks(IGamePlayActions)" />
/// <seealso cref="GamePlayActions.UnregisterCallbacks(IGamePlayActions)" />
public void SetCallbacks(IGamePlayActions instance)
{
foreach (var item in m_Wrapper.m_GamePlayActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_GamePlayActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
/// <summary>
/// Provides a new <see cref="GamePlayActions" /> instance referencing this action map.
/// </summary>
public GamePlayActions @GamePlay => new GamePlayActions(this);
// UI
private readonly InputActionMap m_UI;
private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
private readonly InputAction m_UI_Stop;
private readonly InputAction m_UI_Bag;
/// <summary>
/// Provides access to input actions defined in input action map "UI".
/// </summary>
public struct UIActions
{
private @InputActions m_Wrapper;
/// <summary>
/// Construct a new instance of the input action map wrapper class.
/// </summary>
public UIActions(@InputActions wrapper) { m_Wrapper = wrapper; }
/// <summary>
/// Provides access to the underlying input action "UI/Stop".
/// </summary>
public InputAction @Stop => m_Wrapper.m_UI_Stop;
/// <summary>
/// Provides access to the underlying input action "UI/Bag".
/// </summary>
public InputAction @Bag => m_Wrapper.m_UI_Bag;
/// <summary>
/// Provides access to the underlying input action map instance.
/// </summary>
public InputActionMap Get() { return m_Wrapper.m_UI; }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
public void Enable() { Get().Enable(); }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
public void Disable() { Get().Disable(); }
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
public bool enabled => Get().enabled;
/// <summary>
/// Implicitly converts an <see ref="UIActions" /> to an <see ref="InputActionMap" /> instance.
/// </summary>
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
/// <summary>
/// Adds <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
/// </summary>
/// <param name="instance">Callback instance.</param>
/// <remarks>
/// If <paramref name="instance" /> is <c>null</c> or <paramref name="instance"/> have already been added this method does nothing.
/// </remarks>
/// <seealso cref="UIActions" />
public void AddCallbacks(IUIActions instance)
{
if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance);
@Stop.started += instance.OnStop;
@Stop.performed += instance.OnStop;
@Stop.canceled += instance.OnStop;
@Bag.started += instance.OnBag;
@Bag.performed += instance.OnBag;
@Bag.canceled += instance.OnBag;
}
/// <summary>
/// Removes <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
/// </summary>
/// <remarks>
/// Calling this method when <paramref name="instance" /> have not previously been registered has no side-effects.
/// </remarks>
/// <seealso cref="UIActions" />
private void UnregisterCallbacks(IUIActions instance)
{
@Stop.started -= instance.OnStop;
@Stop.performed -= instance.OnStop;
@Stop.canceled -= instance.OnStop;
@Bag.started -= instance.OnBag;
@Bag.performed -= instance.OnBag;
@Bag.canceled -= instance.OnBag;
}
/// <summary>
/// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="UIActions.UnregisterCallbacks(IUIActions)" />.
/// </summary>
/// <seealso cref="UIActions.UnregisterCallbacks(IUIActions)" />
public void RemoveCallbacks(IUIActions instance)
{
if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
/// <summary>
/// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via <param cref="instance" />.
/// </summary>
/// <remarks>
/// If <paramref name="instance" /> is <c>null</c>, calling this method will only unregister all existing callbacks but not register any new callbacks.
/// </remarks>
/// <seealso cref="UIActions.AddCallbacks(IUIActions)" />
/// <seealso cref="UIActions.RemoveCallbacks(IUIActions)" />
/// <seealso cref="UIActions.UnregisterCallbacks(IUIActions)" />
public void SetCallbacks(IUIActions instance)
{
foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
/// <summary>
/// Provides a new <see cref="UIActions" /> instance referencing this action map.
/// </summary>
public UIActions @UI => new UIActions(this);
private int m_PCSchemeIndex = -1;
/// <summary>
/// Provides access to the input control scheme.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
public InputControlScheme PCScheme
{
get
{
if (m_PCSchemeIndex == -1) m_PCSchemeIndex = asset.FindControlSchemeIndex("PC");
return asset.controlSchemes[m_PCSchemeIndex];
}
}
private int m_GamepadSchemeIndex = -1;
/// <summary>
/// Provides access to the input control scheme.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
public InputControlScheme GamepadScheme
{
get
{
if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad");
return asset.controlSchemes[m_GamepadSchemeIndex];
}
}
/// <summary>
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "GamePlay" which allows adding and removing callbacks.
/// </summary>
/// <seealso cref="GamePlayActions.AddCallbacks(IGamePlayActions)" />
/// <seealso cref="GamePlayActions.RemoveCallbacks(IGamePlayActions)" />
public interface IGamePlayActions
{
/// <summary>
/// Method invoked when associated input action "Move" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnMove(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Dodge" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnDodge(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "ComBa_01" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnComBa_01(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "ComBa_02" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnComBa_02(InputAction.CallbackContext context);
}
/// <summary>
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "UI" which allows adding and removing callbacks.
/// </summary>
/// <seealso cref="UIActions.AddCallbacks(IUIActions)" />
/// <seealso cref="UIActions.RemoveCallbacks(IUIActions)" />
public interface IUIActions
{
/// <summary>
/// Method invoked when associated input action "Stop" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnStop(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Bag" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnBag(InputAction.CallbackContext context);
}
}