Docsv3.30.0
Back to API Reference
Class

UniText3D

sealed
Inherits:UniTextBase
Implements:IGlyphMetricSourceIWorldDecorationHost

Extruded 3D text with bevelled edges: every outline glyph becomes a closed solid laid out, styled and animated by the same pipeline as UniTextWorld, so markup, modifiers and animations move and colour the solids as they move and colour flat glyphs.

Remarks

Renders through the MeshRenderer on its GameObject, which owns shadow casting, probes, layers and sorting; while this component exists, the renderer and the MeshFilter are hidden in the Inspector and the renderer's settings appear in this component's Inspector. Each Text3DSurface draws with its own material; an empty slot falls back as GetSurfaceMaterial describes. Depth, bevels and tolerances are in em of the font size. Range decorations, and glyphs of colour fonts drawn Flat, stay flat on the front of the extrusion, drawn by the shared world batcher and deformed with the solids; the 2D effect layers of modifiers (strokes, shadows, glows) are not drawn. While glyphs animate under materials of Lit and AnimateInShader is set, the shader places them and the mesh holds their unplaced layout until the text rests; pointer queries, colliders, shattering and baking still see the placed text.
public float Depth{ get; set }
public Text3DPivot Pivot{ get; set }
public Text3DBevel FrontBevel{ get; set }
public bool MirrorBevel{ get; set }
public Text3DBevel BackBevel{ get; set }
public bool FrontFace{ get; set }
public bool BackFace{ get; set }
public bool Sides{ get; set }
public bool Glyphs{ get; set }
public float SmoothingAngle{ get; set }
public float CurveTolerance{ get; set }
public Text3DColorGlyphs ColorGlyphs{ get; set }
public float StickerBorder{ get; set }
public bool AdaptiveDetail{ get; set }
public bool BuildInBackground{ get; set }
public bool AnimateInShader{ get; set }
public Text3DBakedSolids BakedSolids{ get; set }
public string WarmCharacters{ get; set }
public Material FaceMaterial{ get; set }
public Material BevelMaterial{ get; set }
public Material SideMaterial{ get; set }
public Material BackBevelMaterial{ get; set }
public Material BackMaterial{ get; set }
public bool IsWorldSpace{ get }
public bool RaycastTarget{ get; set }

When, this text receives pointer events (clicks, hover, interactive ranges) from a WorldPointerRaycaster where the pointer meets its glyphs.

public Text3DGlyphPose CurrentGlyphPose{ get }

The pose of the glyph the mesh build is placing, for modifiers and reveal handlers that move glyphs in depth; identity until a writer of the current build changes it.

public Material GetLayerMaterial()

The material drawing surface of the layer of layer: its face material for faces, its bevel material for bevels and its side material for sides, each else the layer's face material, else the text's material of the surface.

public Material GetSurfaceMaterial()

The material drawing surface: its own slot, else the bevel material for the back bevel, else the face material, else the Default 3D Material of the UniText settings.

protected override void OnCanvasHierarchyChanged()
protected override void UpdateGeometry()
protected override void UpdateRendering()
protected override void ClearAllRenderers()
protected override void ApplyVisibility()
protected override void ApplyAlpha()
protected override Camera ResolveEventCamera()
protected override void OnDeInit()
protected override void OnEnable()
protected override void OnDisable()
protected override void OnDestroy()
public GameObject[] Shatter(List<Material> copies)

Takes the text as last drawn apart into objects: one per glyph with the layers drawn per glyph, and one per shape across glyphs or decoration bar, each drawing its own mesh about its centre with the text's materials and rendering settings. The objects take the text's parent; the text's object turns inactive.

protected override void PrepareForParallel()

Captures on the main thread, before each build, what the build reads from the styles and lays the vertex streams out by: the deform and layer modifiers and their settings, the streams the pipeline's shader reads without their flags, whether the renderer asks for per-object motion, and the vertex count of the mesh.

public bool Raycast()

The nearest point where the world-space ray meets the solids of the text as last drawn — glyphs, layers, plates, bars and stickers — with the place on the glyph it stands for.

public bool TryGetPose()

Where point lies as the text was last drawn, in world space; false when it names no place or the text changed its layout since the place was found.