UIMesh
Bundle of vertex, index, and optional extras slices passed to MeshGenerationContext.DrawMesh.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public struct UIMesh
Remarks
UIMesh.vertices and UIMesh.indices are required. The optional extras (UIMesh.uv1, UIMesh.uv2, UIMesh.uv3, UIMesh.normal, UIMesh.tangent) are channels the panel must have opted into via PanelSettings.extraVertexChannels or IPanel.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 ; mismatches are logged and the entire draw is dropped.
Length == vertices.LengthChannels 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 |
|---|---|
| indices | Triangle list indices. |
| normal | Vertex normals. Padded to |
| tangent | Vertex tangents ( |
| uv1 | UV1 coordinates (TEXCOORD1 in the shader). |
| uv2 | UV2 coordinates (TEXCOORD2 in the shader). |
| uv3 | UV3 coordinates (TEXCOORD3 in the shader). |
| vertices | Vertex positions, colors, and UVs. |