23 lines
532 B
C#
23 lines
532 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GameInput : MonoBehaviour
|
|
{
|
|
|
|
private PlayerInputActions playerInputActions;
|
|
|
|
private void Awake()
|
|
{
|
|
playerInputActions = new PlayerInputActions();
|
|
playerInputActions.Player.Enable();
|
|
}
|
|
public Vector2 GetMovementVectorNormalized()
|
|
{
|
|
Vector2 inputVector = playerInputActions.Player.Move.ReadValue<Vector2>();
|
|
|
|
inputVector = inputVector.normalized;
|
|
|
|
return inputVector;
|
|
}
|
|
}
|