привет я бы хотел чтобы UINavigator ты мне бы помог вынести отдельно работу с Input в какой ни будь IInputService
 public class UINavigator : MonoBehaviour
    {
        public event Action<ItemName> OnNextScreen;
        public event Action OnEarlyScreen;

        private PanelItem currentPanel = null;
        private int selectedPopupIndex = 0;
        private bool isEmptyScreen = false;
        private int selectedCurrentPopupIndex = 0;

        public void SetCurrentPopup(PanelItem panelItem)
        {
            currentPanel = panelItem;

            if (currentPanel.Popup.Length != 0)
            {
                ResetPopupSelection();
                EventSystem.current.SetSelectedGameObject(currentPanel.Popup[currentPanel.SelectedPopupIndex].gameObject);
                currentPanel.Popup[currentPanel.SelectedPopupIndex].Highlighted();
                selectedCurrentPopupIndex = currentPanel.SelectedPopupIndex;
            }
            else
            {
                isEmptyScreen = true;
            }
        }

        private void Update()
        {
            if (isEmptyScreen)
            {
                HandleEmptyScreenInput();
            }
            else
            {
                HandlePopupInput();
            }
        }

        private void HandleEmptyScreenInput()
        {
            if (currentPanel.NextItemName == ItemName.None)
            {
                if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    OnEarlyScreen?.Invoke();
                }
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.Keypad6) || Input.GetKeyDown(KeyCode.RightArrow))
                {
                    OnNextScreen?.Invoke(currentPanel.NextItemName);
                }
                if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    OnEarlyScreen?.Invoke();
                }
            }
        }

        private void HandlePopupInput()
        {
            if (EventSystem.current.currentSelectedGameObject == null)
            {
                EventSystem.current.SetSelectedGameObject(currentPanel.Popup[selectedPopupIndex].gameObject);
            }

            if (Input.GetKeyDown(KeyCode.Keypad8) || Input.GetKeyDown(KeyCode.UpArrow))
            {
                selectedPopupIndex = selectedCurrentPopupIndex;
                SelectFocus(-1);
            }
            if (Input.GetKeyDown(KeyCode.Keypad2) || Input.GetKeyDown(KeyCode.DownArrow))
            {
                selectedPopupIndex = selectedCurrentPopupIndex;
                SelectFocus(1);
            }

            if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.LeftArrow))
            {
                OnEarlyScreen?.Invoke();
            }
            if (Input.GetKeyDown(KeyCode.Keypad6) || Input.GetKeyDown(KeyCode.RightArrow))
            {
                currentPanel.Popup[selectedPopupIndex].Selected();
                currentPanel.SelectedPopupIndex = selectedPopupIndex;
                OnNextScreen?.Invoke(currentPanel.Popup[selectedPopupIndex].WhichScreen);
            }
        }

        private void SelectFocus(int direction)
        {
            EventSystem.current.SetSelectedGameObject(null);

            ResetPopupSelection();

            selectedPopupIndex = (selectedPopupIndex + direction + currentPanel.Popup.Length) % currentPanel.Popup.Length;
            EventSystem.current.SetSelectedGameObject(currentPanel.Popup[selectedPopupIndex].gameObject);
            currentPanel.Popup[selectedPopupIndex].Highlighted();
            selectedCurrentPopupIndex = selectedPopupIndex;
        }

        private void ResetPopupSelection()
        {
            isEmptyScreen = false;

            EventSystem.current.SetSelectedGameObject(null);

            foreach (var item in currentPanel.Popup)
            {
                item.Deselected();
            }
        }
    }