2026-02-16 15:02:20 +01:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.InputSystem;
|
|
|
|
|
|
|
|
|
|
public class PlayerMovement : MonoBehaviour
|
|
|
|
|
{
|
2026-02-24 09:33:08 +01:00
|
|
|
private InputMaster _inputMaster;
|
2026-02-16 15:02:20 +01:00
|
|
|
[SerializeField] private CharacterController controller;
|
|
|
|
|
[SerializeField] private float speed;
|
2026-02-24 09:33:08 +01:00
|
|
|
|
2026-02-16 15:02:20 +01:00
|
|
|
private Vector2 _moveDirection;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
controller = GetComponent<CharacterController>();
|
2026-02-24 09:33:08 +01:00
|
|
|
_inputMaster = new InputMaster();
|
|
|
|
|
_inputMaster.Player.Move.Enable();
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-16 15:02:20 +01:00
|
|
|
public void OnMove(InputAction.CallbackContext context)
|
|
|
|
|
{
|
|
|
|
|
_moveDirection = context.ReadValue<Vector2>();
|
|
|
|
|
Debug.Log("direction: " + _moveDirection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|