This commit is contained in:
陈思海 2025-12-22 11:28:47 +08:00
parent 8a0a2b1a00
commit e0d8f77730

View File

@ -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;
}
}
}