A subtree is pruned at any node that is visible = false or
enabled = false — a hidden panel's buttons are not clickable, and pruning
at the node rather than filtering per widget means a plain Group hides its
UI descendants too. A widget that survives the walk is a candidate unless it
is UIWidget.interactive= false, which drops that widget alone and
keeps its children.
The order matters: pick sorts hits by distance with a stable sort, and
coplanar widgets are all at the same distance, so a tie resolves to whichever
came first here — the ancestor. A child that must win over its parent needs a
real depth difference, which is why layout never writes z: set
child.transform.position.z (a few thousandths toward the camera is enough)
and the picker orders them properly.
Zero-alloc when out is supplied: it is overwritten and truncated.
Collects the §71 picking candidates of a UI tree into
out, root first and then depth-first in insertion order, and returns it.A subtree is pruned at any node that is
visible = falseorenabled = false— a hidden panel's buttons are not clickable, and pruning at the node rather than filtering per widget means a plainGrouphides its UI descendants too. A widget that survives the walk is a candidate unless it is UIWidget.interactive= false, which drops that widget alone and keeps its children.The order matters:
picksorts hits by distance with a stable sort, and coplanar widgets are all at the same distance, so a tie resolves to whichever came first here — the ancestor. A child that must win over its parent needs a real depth difference, which is why layout never writesz: setchild.transform.position.z(a few thousandths toward the camera is enough) and the picker orders them properly.Zero-alloc when
outis supplied: it is overwritten and truncated.