679 lines
32 KiB
C#
679 lines
32 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.InputSystem;
|
|
using UnityEngine.InputSystem.Utilities;
|
|
|
|
public partial class @GameInput: IInputActionCollection2, IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Provides access to the underlying asset instance.
|
|
/// </summary>
|
|
public InputActionAsset asset { get; }
|
|
|
|
/// <summary>
|
|
/// Constructs a new instance.
|
|
/// </summary>
|
|
public @GameInput()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""version"": 1,
|
|
""name"": ""GameInput"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Player"",
|
|
""id"": ""e331468a-870b-4a9d-adfc-33c89a2aa65d"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Move"",
|
|
""type"": ""Value"",
|
|
""id"": ""63ac178d-1333-427a-9f57-780afc877807"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""Jump"",
|
|
""type"": ""Button"",
|
|
""id"": ""a8c7f1d2-3e4b-4a5c-9d6e-7f8901234567"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Punch"",
|
|
""type"": ""Button"",
|
|
""id"": ""3dcb1343-a166-469d-990e-24ccedf2d09e"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Kick"",
|
|
""type"": ""Button"",
|
|
""id"": ""1af50460-846d-4f2a-8030-f9712ad7df6b"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Dash"",
|
|
""type"": ""Button"",
|
|
""id"": ""4245d8e3-7e61-4548-84af-75512958eb2f"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Roll"",
|
|
""type"": ""Button"",
|
|
""id"": ""7e00ae7c-ad0c-460d-be3d-0072054ceb9c"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""BackDash"",
|
|
""type"": ""Button"",
|
|
""id"": ""673f5cb8-598b-48d3-bef8-0092cf7f4ba6"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""GrabSmash"",
|
|
""type"": ""Button"",
|
|
""id"": ""c42f3219-3aca-4678-8a86-b74565af3747"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""WeaponSlot1"",
|
|
""type"": ""Button"",
|
|
""id"": ""a1b2c3d4-1111-1111-1111-111111111111"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""WeaponSlot2"",
|
|
""type"": ""Button"",
|
|
""id"": ""a1b2c3d4-2222-2222-2222-222222222222"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""WeaponSlot3"",
|
|
""type"": ""Button"",
|
|
""id"": ""a1b2c3d4-3333-3333-3333-333333333333"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""2D Vector"",
|
|
""id"": ""1c7aa2cd-7385-4e38-8392-a1cecb8adc98"",
|
|
""path"": ""2DVector"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""50a77fe5-4fb2-4e7a-bd0c-973407f67e90"",
|
|
""path"": ""<Keyboard>/upArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""2306a862-a3c3-48b1-8a28-ce80c7d9e2ea"",
|
|
""path"": ""<Keyboard>/downArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""819efc78-8db1-481e-b737-4fef39f2fa3f"",
|
|
""path"": ""<Keyboard>/leftArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""eab43684-ffd8-44c3-bca7-03dce6685fbb"",
|
|
""path"": ""<Keyboard>/rightArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b9d8e2f3-4a5c-4b6d-8e7f-901234567890"",
|
|
""path"": ""<Keyboard>/c"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""9f28cd37-d35c-4f36-8af0-a0020d508486"",
|
|
""path"": ""<Keyboard>/z"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Punch"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""43e56be6-df9b-4845-ba12-cd109ac1ffa0"",
|
|
""path"": ""<Keyboard>/x"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Kick"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""8bca2399-c8c8-41e8-a3b2-08267c8bc571"",
|
|
""path"": ""<Keyboard>/leftShift"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Dash"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""df4d72ec-012c-413a-862d-1a36d2c5b69a"",
|
|
""path"": ""<Keyboard>/leftCtrl"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Roll"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""4c51b02e-aa8f-4242-81e4-ab1c72a512df"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""BackDash"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""8635811d-29ac-4047-a3f7-d7a72f7e362e"",
|
|
""path"": ""<Keyboard>/g"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""GrabSmash"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b1c2d3e4-1111-1111-1111-111111111111"",
|
|
""path"": ""<Keyboard>/1"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""WeaponSlot1"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b1c2d3e4-2222-2222-2222-222222222222"",
|
|
""path"": ""<Keyboard>/2"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""WeaponSlot2"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b1c2d3e4-3333-3333-3333-333333333333"",
|
|
""path"": ""<Keyboard>/3"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""WeaponSlot3"",
|
|
""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_Punch = m_Player.FindAction("Punch", throwIfNotFound: true);
|
|
m_Player_Kick = m_Player.FindAction("Kick", throwIfNotFound: true);
|
|
m_Player_Dash = m_Player.FindAction("Dash", throwIfNotFound: true);
|
|
m_Player_Roll = m_Player.FindAction("Roll", throwIfNotFound: true);
|
|
m_Player_BackDash = m_Player.FindAction("BackDash", throwIfNotFound: true);
|
|
m_Player_GrabSmash = m_Player.FindAction("GrabSmash", throwIfNotFound: true);
|
|
m_Player_WeaponSlot1 = m_Player.FindAction("WeaponSlot1", throwIfNotFound: true);
|
|
m_Player_WeaponSlot2 = m_Player.FindAction("WeaponSlot2", throwIfNotFound: true);
|
|
m_Player_WeaponSlot3 = m_Player.FindAction("WeaponSlot3", throwIfNotFound: true);
|
|
}
|
|
|
|
~@GameInput()
|
|
{
|
|
UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, GameInput.Player.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);
|
|
}
|
|
|
|
// Player
|
|
private readonly InputActionMap m_Player;
|
|
private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
|
|
private readonly InputAction m_Player_Move;
|
|
private readonly InputAction m_Player_Jump;
|
|
private readonly InputAction m_Player_Punch;
|
|
private readonly InputAction m_Player_Kick;
|
|
private readonly InputAction m_Player_Dash;
|
|
private readonly InputAction m_Player_Roll;
|
|
private readonly InputAction m_Player_BackDash;
|
|
private readonly InputAction m_Player_GrabSmash;
|
|
private readonly InputAction m_Player_WeaponSlot1;
|
|
private readonly InputAction m_Player_WeaponSlot2;
|
|
private readonly InputAction m_Player_WeaponSlot3;
|
|
/// <summary>
|
|
/// Provides access to input actions defined in input action map "Player".
|
|
/// </summary>
|
|
public struct PlayerActions
|
|
{
|
|
private @GameInput m_Wrapper;
|
|
|
|
/// <summary>
|
|
/// Construct a new instance of the input action map wrapper class.
|
|
/// </summary>
|
|
public PlayerActions(@GameInput wrapper) { m_Wrapper = wrapper; }
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Move".
|
|
/// </summary>
|
|
public InputAction @Move => m_Wrapper.m_Player_Move;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Jump".
|
|
/// </summary>
|
|
public InputAction @Jump => m_Wrapper.m_Player_Jump;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Punch".
|
|
/// </summary>
|
|
public InputAction @Punch => m_Wrapper.m_Player_Punch;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Kick".
|
|
/// </summary>
|
|
public InputAction @Kick => m_Wrapper.m_Player_Kick;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Dash".
|
|
/// </summary>
|
|
public InputAction @Dash => m_Wrapper.m_Player_Dash;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/Roll".
|
|
/// </summary>
|
|
public InputAction @Roll => m_Wrapper.m_Player_Roll;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/BackDash".
|
|
/// </summary>
|
|
public InputAction @BackDash => m_Wrapper.m_Player_BackDash;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/GrabSmash".
|
|
/// </summary>
|
|
public InputAction @GrabSmash => m_Wrapper.m_Player_GrabSmash;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/WeaponSlot1".
|
|
/// </summary>
|
|
public InputAction @WeaponSlot1 => m_Wrapper.m_Player_WeaponSlot1;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/WeaponSlot2".
|
|
/// </summary>
|
|
public InputAction @WeaponSlot2 => m_Wrapper.m_Player_WeaponSlot2;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Player/WeaponSlot3".
|
|
/// </summary>
|
|
public InputAction @WeaponSlot3 => m_Wrapper.m_Player_WeaponSlot3;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action map instance.
|
|
/// </summary>
|
|
public InputActionMap Get() { return m_Wrapper.m_Player; }
|
|
/// <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="PlayerActions" /> to an <see ref="InputActionMap" /> instance.
|
|
/// </summary>
|
|
public static implicit operator InputActionMap(PlayerActions 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="PlayerActions" />
|
|
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;
|
|
@Punch.started += instance.OnPunch;
|
|
@Punch.performed += instance.OnPunch;
|
|
@Punch.canceled += instance.OnPunch;
|
|
@Kick.started += instance.OnKick;
|
|
@Kick.performed += instance.OnKick;
|
|
@Kick.canceled += instance.OnKick;
|
|
@Dash.started += instance.OnDash;
|
|
@Dash.performed += instance.OnDash;
|
|
@Dash.canceled += instance.OnDash;
|
|
@Roll.started += instance.OnRoll;
|
|
@Roll.performed += instance.OnRoll;
|
|
@Roll.canceled += instance.OnRoll;
|
|
@BackDash.started += instance.OnBackDash;
|
|
@BackDash.performed += instance.OnBackDash;
|
|
@BackDash.canceled += instance.OnBackDash;
|
|
@GrabSmash.started += instance.OnGrabSmash;
|
|
@GrabSmash.performed += instance.OnGrabSmash;
|
|
@GrabSmash.canceled += instance.OnGrabSmash;
|
|
@WeaponSlot1.started += instance.OnWeaponSlot1;
|
|
@WeaponSlot1.performed += instance.OnWeaponSlot1;
|
|
@WeaponSlot1.canceled += instance.OnWeaponSlot1;
|
|
@WeaponSlot2.started += instance.OnWeaponSlot2;
|
|
@WeaponSlot2.performed += instance.OnWeaponSlot2;
|
|
@WeaponSlot2.canceled += instance.OnWeaponSlot2;
|
|
@WeaponSlot3.started += instance.OnWeaponSlot3;
|
|
@WeaponSlot3.performed += instance.OnWeaponSlot3;
|
|
@WeaponSlot3.canceled += instance.OnWeaponSlot3;
|
|
}
|
|
|
|
/// <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="PlayerActions" />
|
|
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;
|
|
@Punch.started -= instance.OnPunch;
|
|
@Punch.performed -= instance.OnPunch;
|
|
@Punch.canceled -= instance.OnPunch;
|
|
@Kick.started -= instance.OnKick;
|
|
@Kick.performed -= instance.OnKick;
|
|
@Kick.canceled -= instance.OnKick;
|
|
@Dash.started -= instance.OnDash;
|
|
@Dash.performed -= instance.OnDash;
|
|
@Dash.canceled -= instance.OnDash;
|
|
@Roll.started -= instance.OnRoll;
|
|
@Roll.performed -= instance.OnRoll;
|
|
@Roll.canceled -= instance.OnRoll;
|
|
@BackDash.started -= instance.OnBackDash;
|
|
@BackDash.performed -= instance.OnBackDash;
|
|
@BackDash.canceled -= instance.OnBackDash;
|
|
@GrabSmash.started -= instance.OnGrabSmash;
|
|
@GrabSmash.performed -= instance.OnGrabSmash;
|
|
@GrabSmash.canceled -= instance.OnGrabSmash;
|
|
@WeaponSlot1.started -= instance.OnWeaponSlot1;
|
|
@WeaponSlot1.performed -= instance.OnWeaponSlot1;
|
|
@WeaponSlot1.canceled -= instance.OnWeaponSlot1;
|
|
@WeaponSlot2.started -= instance.OnWeaponSlot2;
|
|
@WeaponSlot2.performed -= instance.OnWeaponSlot2;
|
|
@WeaponSlot2.canceled -= instance.OnWeaponSlot2;
|
|
@WeaponSlot3.started -= instance.OnWeaponSlot3;
|
|
@WeaponSlot3.performed -= instance.OnWeaponSlot3;
|
|
@WeaponSlot3.canceled -= instance.OnWeaponSlot3;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="PlayerActions.UnregisterCallbacks(IPlayerActions)" />.
|
|
/// </summary>
|
|
/// <seealso cref="PlayerActions.UnregisterCallbacks(IPlayerActions)" />
|
|
public void RemoveCallbacks(IPlayerActions instance)
|
|
{
|
|
if (m_Wrapper.m_PlayerActionsCallbackInterfaces.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="PlayerActions.AddCallbacks(IPlayerActions)" />
|
|
/// <seealso cref="PlayerActions.RemoveCallbacks(IPlayerActions)" />
|
|
/// <seealso cref="PlayerActions.UnregisterCallbacks(IPlayerActions)" />
|
|
public void SetCallbacks(IPlayerActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Provides a new <see cref="PlayerActions" /> instance referencing this action map.
|
|
/// </summary>
|
|
public PlayerActions @Player => new PlayerActions(this);
|
|
/// <summary>
|
|
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Player" which allows adding and removing callbacks.
|
|
/// </summary>
|
|
/// <seealso cref="PlayerActions.AddCallbacks(IPlayerActions)" />
|
|
/// <seealso cref="PlayerActions.RemoveCallbacks(IPlayerActions)" />
|
|
public interface IPlayerActions
|
|
{
|
|
/// <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 "Jump" 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 OnJump(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Punch" 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 OnPunch(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Kick" 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 OnKick(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Dash" 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 OnDash(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Roll" 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 OnRoll(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "BackDash" 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 OnBackDash(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "GrabSmash" 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 OnGrabSmash(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "WeaponSlot1" 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 OnWeaponSlot1(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "WeaponSlot2" 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 OnWeaponSlot2(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "WeaponSlot3" 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 OnWeaponSlot3(InputAction.CallbackContext context);
|
|
}
|
|
}
|