Files
Knight_Hollow/Assets/Scripts/PlayerController.cs
2025-06-05 03:21:27 +09:00

20 lines
387 B
C#

using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Movement2D movement2D;
private void Awake()
{
movement2D = GetComponent<Movement2D>();
}
private void Update()
{
float x = Input.GetAxis("Horizontal");
float y = Input.GetAxis("Vertical");
movement2D.MoveDirection = new Vector2(x, y);
}
}