24 lines
582 B
C#
24 lines
582 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
public class PlayerMovement : MonoBehaviour
|
|
{
|
|
[SerializeField] private CharacterController controller;
|
|
[SerializeField] private float speed;
|
|
|
|
private Vector2 _moveDirection;
|
|
|
|
private void Awake()
|
|
{
|
|
controller = GetComponent<CharacterController>();
|
|
}
|
|
|
|
public void OnMove(InputAction.CallbackContext context)
|
|
{
|
|
_moveDirection = context.ReadValue<Vector2>();
|
|
Debug.Log("direction: " + _moveDirection);
|
|
}
|
|
|
|
} |