Method WorldSpace
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
WorldSpace(Vector3, Quaternion?, Vector2?, VNode?[]?, string?, PanelFocusOrder)
Renders children into a framework-owned world-space panel positioned by
a scene transform — UI that lives among 3D content and is depth-tested against it, unlike
the always-on-top screen-space layers. The host
(GameObject + world-space panel) is created on mount, follows position /
rotation updates, and is destroyed on unmount. Children stay part of the
logical tree: context and state cross, and an events: handler on a logical ancestor
of the call site also fires for a pointer / key / focus event raised on a child, bridged
synthetically across the separate host Panel. Velvet does not arbitrate world-space pointer
DELIVERY itself the way it does screen-space layer picking order: Unity's own runtime input
system picks the host through the collider the host's UIDocument keeps on it and delivers
pointer input once a Play session is running (see the package's cross-panel input routing
docs). The event bridging above applies to whatever that system delivers, as well as
to a programmatically dispatched event (e.g. in tests).
public static WorldSpaceNode WorldSpace(Vector3 position, Quaternion? rotation = null, Vector2? panelSize = null, VNode?[]? children = null, string? key = null, PanelFocusOrder focusOrder = PanelFocusOrder.Appended)
Parameters
positionVector3World position of the panel host.
rotationQuaternion?World rotation of the panel host (identity when omitted).
panelSizeVector2?Virtual panel resolution in pixels (fixed world-space size mode).
childrenVNode[]Descendant VNodes rendered inside the world-space panel.
keystringKey used to disambiguate siblings at the same position.
focusOrderPanelFocusOrderWhere the children sit in Tab order; by default after every element of the panel the tree is mounted on, as a portal into a document's body.
Returns
- WorldSpaceNode
The created WorldSpaceNode.
Exceptions
- ArgumentOutOfRangeException
focusOrdernames no member of PanelFocusOrder.