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

MeshModificationContext.AllocateUIMesh

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

Declaration

public void AllocateUIMesh(ExtraVertexChannels channels, int vertexCount, int indexCount, out UIMesh mesh);

Description

Allocates a fresh temporary UIMesh sized for vertices and indices, with slices for the requested extras .


Channels not requested return as empty slices on the resulting UIMesh. Use the result as input to DrawData.SetMesh for tessellation refinement or wholesale geometry replacement. Memory is valid for the duration of this callback and any jobs added via MeshModificationContext.AddMeshModificationJob.

Requested channels that are NOT enabled on the panel's ExtraVertexChannels mask are dropped and the resulting UIMesh returns empty slices for those channels. Check slice lengths before filling.