Initial commit
This commit is contained in:
26
Assets/Scripts/InputReader.cs
Normal file
26
Assets/Scripts/InputReader.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using static GameInputs;
|
||||
|
||||
public class InputReader : ScriptableObject, IInputReader, IPlayerActions
|
||||
{
|
||||
private GameInputs _inputActions;
|
||||
|
||||
public Vector2 DragInput { get; private set;}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (_inputActions == null)
|
||||
{
|
||||
_inputActions = new GameInputs();
|
||||
_inputActions.Player.SetCallbacks(this);
|
||||
}
|
||||
_inputActions.Enable();
|
||||
}
|
||||
public void OnDrag(InputAction.CallbackContext context)
|
||||
{
|
||||
DragInput = context.ReadValue<Vector2>();
|
||||
Debug.Log(DragInput);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user