Files
Unity20GameJam/Assets/Gameplay/Scripts/Frist/PlayerCtrl.cs
2025-11-08 17:07:00 +08:00

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()
{
}
}