Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UIMesh

Bundle of vertex, index, and optional extras slices passed to MeshGenerationContext.DrawMesh.
Read time 1 minuteLast updated 11 days ago

Definition

public struct UIMesh

Remarks

_vertices and _indices are required. The optional extras (_uv1, _uv2, _uv3, _normal, _tangent) are channels the panel must have opted into via _extraVertexChannels or _extraVertexChannels. Providing a slice for a channel the panel did not enable logs an error and drops that slice.
Each non-empty extras slice must have
Length == vertices.Length
; mismatches are logged and the entire draw is dropped.
Channels enabled on the panel but left empty in the draw are zero-filled.
Slices passed to MeshGenerationContext.DrawMesh are read at flush time, not at the call site. Slices returned by MeshGenerationContext.AllocateTempMesh are guaranteed valid through the flush; user-supplied slices must remain valid until the same flush point.

Properties

Property

Description

indicesTriangle list indices.
normalVertex normals. Padded to
Vector4
on the GPU (
.w
zero-filled).
tangentVertex tangents (
.w
= handedness).
uv1UV1 coordinates (TEXCOORD1 in the shader).
uv2UV2 coordinates (TEXCOORD2 in the shader).
uv3UV3 coordinates (TEXCOORD3 in the shader).
verticesVertex positions, colors, and UVs.