24 lines
553 B
C#
24 lines
553 B
C#
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
public class PlayerCtrl : MonoBehaviour
|
|
{
|
|
InputAction inputAction;
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
inputAction = FindAnyObjectByType<PlayerInput>().actions["Move"];
|
|
inputAction.performed += (ctx) =>
|
|
{
|
|
Vector2 value = ctx.ReadValue<Vector2>();
|
|
Debug.Log(value);
|
|
};
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|