Provides programmatic access to InputActionAsset, InputActionMap, InputAction and InputControlScheme instances defined in asset "Assets/SoftLeitner/AdventureExtras/Arena/ArenaInput.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;
public class Example : MonoBehaviour, MyActions.IPlayerActions
{
private MyActions_Actions m_Actions;
private MyActions_Actions.PlayerActions m_Player;
void Awake()
{
m_Actions = new MyActions_Actions();
m_Player = m_Actions.Player;
m_Player.AddCallbacks(this);
}
void OnDestroy()
{
m_Actions.Dispose();
}
void OnEnable()
{
m_Player.Enable();
}
void OnDisable()
{
m_Player.Disable();
}
#region Interface implementation of MyActions.IPlayerActions
public void OnMove(InputAction.CallbackContext context)
{
Debug.Log($"OnMove: {context.ReadValue<Vector2>()}");
}
public void OnAttack(InputAction.CallbackContext context)
{
Debug.Log($"OnAttack: {context.ReadValue<float>()}");
}
#endregion
}