private void OnAccept(UISlot slot)
 {
     OnClick(slot);
     UISlotPanel.UnfocusAll();
     if (prev_panel != null)
     {
         prev_panel.Focus();
     }
 }
        public void NavigateTo(UISlot slot, Vector2 dir)
        {
            UISlotPanel panel = slot?.GetParent();

            if (panel != null && panel.IsVisible())
            {
                panel.Focus();
                panel.selection_index = slot.index;
            }
            else
            {
                Navigate(panel, dir);
            }
        }
        public void Navigate(UISlotPanel panel, Vector2 dir)
        {
            UISlot current = panel?.GetSelectSlot();

            if (panel == null || current == null)
            {
                if (IsLeft(dir))
                {
                    panel = default_left;
                }
                else if (IsRight(dir))
                {
                    panel = default_right;
                }
                else if (IsUp(dir))
                {
                    panel = default_top;
                }
                else if (IsDown(dir))
                {
                    panel = default_down;
                }
                panel.Focus();
            }
            else
            {
                if (IsLeft(dir) && current.left)
                {
                    NavigateTo(current.left, dir);
                }
                else if (IsRight(dir) && current.right)
                {
                    NavigateTo(current.right, dir);
                }
                else if (IsUp(dir) && current.top)
                {
                    NavigateTo(current.top, dir);
                }
                else if (IsDown(dir) && current.down)
                {
                    NavigateTo(current.down, dir);
                }
                else
                {
                    NavigateAuto(panel, dir);
                }
            }
        }