This commit is contained in:
xinkl
2025-11-08 17:07:00 +08:00
parent ccf87a7a0f
commit 29f801ec12
18 changed files with 494 additions and 40 deletions

View File

@@ -0,0 +1,23 @@
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()
{
}
}