using UnityEngine; namespace Aliciza.Services.Example { [DefaultExecutionOrder(-100)] public sealed class ExampleInputManager : MonoServiceBehaviour, IInputService { [SerializeField] private string _horizontalAxis = "Horizontal"; [SerializeField] private string _verticalAxis = "Vertical"; [SerializeField] private KeyCode _confirmKey = KeyCode.Space; [SerializeField] private KeyCode _toggleBattleKey = KeyCode.B; public Vector2 Move { get; private set; } public bool ConfirmPressedThisFrame { get; private set; } public bool ToggleBattlePressedThisFrame { get; private set; } private void Update() { Move = new Vector2(Input.GetAxisRaw(_horizontalAxis), Input.GetAxisRaw(_verticalAxis)); ConfirmPressedThisFrame = Input.GetKeyDown(_confirmKey); ToggleBattlePressedThisFrame = Input.GetKeyDown(_toggleBattleKey); } private void LateUpdate() { ConfirmPressedThisFrame = false; ToggleBattlePressedThisFrame = false; } protected override void OnServiceDestroy() { Move = Vector2.zero; ConfirmPressedThisFrame = false; ToggleBattlePressedThisFrame = false; } } }