using System; using UnityEngine; namespace GameOff.Player { [DefaultExecutionOrder(-100)] public class PlayerInputHandler: MonoBehaviour { public event EventHandler OnChangeState; public Vector2 Mouse { get; private set; } private GameInputs _input; private void Awake() { _input = new GameInputs(); } private void OnEnable() { _input.Player.Enable(); } private void OnDisable() { _input.Player.Disable(); } private void Start() { _input.Player.ChangeState.performed += _ => OnChangeState?.Invoke(this, EventArgs.Empty); } private void Update() { Mouse = _input.Player.Mouse.ReadValue(); } } }