Docsv3.31.0
Back to API Reference
Class

UniTextWorld

Inherits:UniTextBase
Implements:IWorldDecorationHost

World-space text component. Renders via WorldBatcher with full Unicode support — bidirectional scripts, complex shaping, color emoji, markup.

Remarks

For Canvas-space (UI) text, use UniText.
public int SortingOrder{ get; set }

Gets or sets the sorting order for render ordering.

public int SortingLayerID{ get; set }

Gets or sets the sorting layer ID.

public bool Lit{ get; set }

Gets or sets whether this text receives scene lighting.

public bool CastShadows{ get; set }

Gets or sets whether this text casts shadows onto other objects.

public bool Standalone{ get; set }

Gets or sets whether this text renders through a renderer of its own instead of joining the shared batch mesh.

public static IReadOnlyList<UniTextWorld> Active{ get }

All currently enabled UniTextWorld instances, maintained by OnEnable / OnDisable. Iterate this instead of FindObjectsOfType.

public bool IsWorldSpace{ get }

Whether this text renders in world space (a scene mesh) rather than in a Canvas. Consumers that adapt to render space query this instead of testing for a concrete component type; UniTextWorld overrides it to true.

public bool RaycastTarget{ get; set }

When true, this text receives pointer events (clicks, hover, interactive ranges) from a WorldPointerRaycaster. Disable for purely decorative text — the raycaster will skip it.

protected bool PositionFollowsGeometry{ get }

World text is a plane a camera looks at: its document position is where the camera looks.

protected override void OnCanvasHierarchyChanged()
protected override void UpdateGeometry()
protected override void UpdateRendering()
protected override void ClearAllRenderers()
protected override void ApplyVisibility()

Applies the current RenderSuppressed state to the rendering backend. Must only toggle drawing — cull for Canvas, batch membership (degenerate indices) for world — never tear down or rebuild, so the user Show/Hide and the scene-visibility eye share one allocation-free, non-structural path.

protected override void ApplyAlpha()

Applies the alpha of color to the rendering backend; the built mesh carries none. Like ApplyVisibility, it must only change how the built output is drawn — never rebuild it — so a fade costs no layout and no mesh pass.

protected override void ApplyTint()

Applies the red, green and blue of color to the rendering backend. When the latest generation's render data carries them only through its UniTextRenderData.tinted entries, the backend recolours those the way ApplyAlpha fades, without a mesh pass; otherwise it rebuilds the mesh. An override in a subclass of UniText or UniTextWorld calls the base.

protected override void OnEnable()
protected override void OnDisable()
protected override void OnTransformParentChanged()
protected override void OnDeInit()
protected override Camera ResolveEventCamera(PointerEventData eventData)

Resolves the camera to use for screen-to-local conversion based on the event source.

protected override void ResolveViewportBounds(out Nullable<Rect> automatic, out Nullable<Rect> display)

Supplies, for a text holding a document, a camera's view on the text's plane as the display: the main camera when it renders this text, otherwise the game camera that draws it last, and in the editor the scene view's camera when the scene holds none. The view places the document and bounds what virtualization materializes of a large text, but clips nothing — the batch mesh serves every camera, so text a camera moves past stays whole. A camera adapter that supplies the projected scale owns the display and its window already is the camera's projection, so nothing narrows it. With no camera at all only the document's top is materialized. A text without a document has nothing a camera's view would place, so its viewport is its own rect and no camera is resolved for it.

protected override float ProjectedEmPixels()
public static Action<UniTextWorld> Activated

Occurs when a UniTextWorld instance has become active (OnEnable).

public static Action<UniTextWorld> Deactivated

Occurs when a UniTextWorld instance has become inactive (OnDisable).

public Action<UniTextWorld> RenderDataAvailable

Occurs when the component's mesh has been generated and render data is available through UniTextBase.MeshGenerator.UniTextMeshGenerator.CollectRenderData.

public Action<UniTextWorld> RenderDataCleared

Occurs when the component's render data should be discarded (e.g. empty text, disabled).

public Action<UniTextWorld> RenderSuppressionChanged

Occurs when RenderSuppressed has toggled (user Hide/Show or scene-visibility). The batcher reads the live state and flips this component's batch membership without a structural rebuild.

public Action<UniTextWorld> AlphaChanged

Occurs when the alpha of UniTextBase.color has changed. Render data carries no component alpha: the batcher reads the live value and re-uploads this component's colours with it, without a rebuild.

public Action<UniTextWorld> SortingChanged

Occurs when a sorting-context input has changed: SortingOrder, SortingLayerID, CastShadows or Standalone (all are batch-key components).

public Action<UniTextWorld> ParentChanged

Occurs when the component's transform parent has changed (may invalidate SortingGroup inheritance).