35 lines
783 B
C#
35 lines
783 B
C#
using UnityEngine;
|
|
using static InputActions;
|
|
|
|
public class InputManager : MonoBehaviour
|
|
{
|
|
private InputActions _inputActions;
|
|
public static InputManager Instance { get; private set; }
|
|
|
|
public PlayerActions PlayerAction { get; private set; }
|
|
public CameraActions CameraAction { get; private set; }
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
if (Instance != null)
|
|
{
|
|
Debug.Log("There's more than one Input manager instance");
|
|
}
|
|
Instance = this;
|
|
|
|
_inputActions = new InputActions();
|
|
|
|
PlayerAction = _inputActions.Player;
|
|
CameraAction = _inputActions.Camera;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
_inputActions.Enable();
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
_inputActions.Disable();
|
|
}
|
|
} |