From e0d8f77730cadce04f88535c69a193ced7d21a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Mon, 22 Dec 2025 11:28:47 +0800 Subject: [PATCH] fix --- .../UXComponent/Selectable/UXSelectable.cs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/Runtime/UXComponent/Selectable/UXSelectable.cs b/Runtime/UXComponent/Selectable/UXSelectable.cs index f0024c0..e625c09 100644 --- a/Runtime/UXComponent/Selectable/UXSelectable.cs +++ b/Runtime/UXComponent/Selectable/UXSelectable.cs @@ -113,5 +113,65 @@ namespace UnityEngine.UI } } } + + public override Selectable FindSelectableOnLeft() + { + if (navigation.mode == Navigation.Mode.Explicit && navigation.selectOnLeft != null && navigation.selectOnLeft.interactable) + { + return navigation.selectOnLeft; + } + + if ((navigation.mode & Navigation.Mode.Horizontal) != 0) + { + return FindSelectable(transform.rotation * Vector3.left); + } + + return null; + } + + public override Selectable FindSelectableOnRight() + { + if (navigation.mode == Navigation.Mode.Explicit && navigation.selectOnRight != null && navigation.selectOnRight.interactable) + { + return navigation.selectOnRight; + } + + if ((navigation.mode & Navigation.Mode.Horizontal) != 0) + { + return FindSelectable(transform.rotation * Vector3.right); + } + + return null; + } + + public override Selectable FindSelectableOnUp() + { + if (navigation.mode == Navigation.Mode.Explicit && navigation.selectOnUp != null && navigation.selectOnUp.interactable) + { + return navigation.selectOnUp; + } + + if ((navigation.mode & Navigation.Mode.Vertical) != 0) + { + return FindSelectable(transform.rotation * Vector3.up); + } + + return null; + } + + public override Selectable FindSelectableOnDown() + { + if (navigation.mode == Navigation.Mode.Explicit && navigation.selectOnDown != null && navigation.selectOnDown.interactable) + { + return navigation.selectOnDown; + } + + if ((navigation.mode & Navigation.Mode.Vertical) != 0) + { + return FindSelectable(transform.rotation * Vector3.down); + } + + return null; + } } }