UniTextMeshGenerator
Converts positioned glyphs into Unity mesh data for text rendering.
Remarks
public UniTextRenderMode RenderMode{ get; set }Gets or sets the atlas mode (SDF or MSDF) for glyph lookup and material selection.
public Vector3[] Vertices{ get }Gets the vertex position buffer (X, Y, Z coordinates).
public Vector4[] Uvs0{ get }Gets the primary UV buffer (texture coordinates and scale in W component).
public Color32[] Colors{ get }Gets the vertex color buffer.
public Vector4[] Uvs1{ get }Gets the UV1 buffer: x = aspect (glyphW/glyphH), y = face dilate.
public Vector4[] Uvs2{ get }Gets the UV2 buffer containing layer 2 (underlay/shadow) parameters.
public Vector4[] Uvs3{ get }Gets the UV3 buffer containing layer 3 (underlay/shadow) parameters.
[ctor]public UniTextMeshGenerator(UniTextFontProvider fontProvider, UniTextBuffers uniTextBuffers)Initializes a new instance of the UniTextMeshGenerator class.
public void SetRectOffset(Rect rect)Sets the layout rectangle for text positioning.
public List<UniTextRenderData> CollectRenderData()Collects raw render data (vertex/UV/triangle array slices + material/order metadata) for every segment produced by the latest mesh generation. Does not build Unity Mesh objects — consumers (canvas UpdateSubMeshes, world batcher) decide what to do with the raw data.
public Color32 defaultColorDefault vertex color applied to all glyphs.
public UniTextFont fontCurrent font being processed.
public Action onMainPassCompleteInvoked after the main glyph loop completes, before any finalization phase. Subscribers may emit additional quads into the open vertex stream; if they call onGlyph for each emitted quad with isVirtualGlyph set, per-glyph modifiers (color, gradient, bold) and effect modifiers (outline, shadow, extrude) pick up the new quads through the standard pipeline.
public Action onMainPassFinalizeFinalization phase for the main glyph pass (SDF). Runs after onMainPassComplete and before the emoji segment is processed.
public Action onGlyphInvoked for each glyph during mesh generation.
public Action onRebuildEndInvoked after all mesh generation is complete.
public Action onRebuildStartInvoked before mesh generation starts.
public Action<List<UniTextRenderData>> onCollectSubMeshesInvoked by CollectRenderData after base SDF/emoji segments are written to the result buffer, but before the buffer is sorted and returned. Subscribers append their own UniTextRenderData entries (each with a custom materialOverride, atlasOverride, order and sortIndex) to the provided list.
True when the currently processed glyph is virtual (injected by a modifier — list marker, ellipsis dot — and has no ShapedGlyph behind it).
public EffectPass currentEffectPassDetermines where EffectModifier duplicate quads (outline, shadow, extrude) land in the index buffer for the currently processed glyph.
