Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

UIMesh

struct in UnityEngine.UIElements

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Bundle of vertex, index, and optional extras slices passed to MeshGenerationContext.DrawMesh.


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 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.