Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AllocateTempMesh

Allocates the specified number of vertices and indices from a temporary allocator.
Read time 1 minuteLast updated 13 days ago

Definition

AllocateTempMesh(int, int, NativeSlice<Vertex>, NativeSlice<ushort>)

Allocates the specified number of vertices and indices from a temporary allocator.
public void AllocateTempMesh(int vertexCount, int indexCount, out NativeSlice<Vertex> vertices, out NativeSlice<ushort> indices)

Parameters

vertexCount

The number of vertices to allocate, with a maximum limit of 65535 (or UInt16.MaxValue).

indexCount

The number of triangle list indices to allocate, where every three indices represent one triangle. Therefore, this value should always be a multiple of three.

The returned vertices.

The returned indices.

Remarks

You can only call this method during the mesh generation phase of the panel and shouldn't use it beyond.

AllocateTempMesh(ExtraVertexChannels, int, int, UIMesh)

Allocates a temporary UIMesh with mandatory vertex+index storage and one extras slice per channel set in
extraChannels
.
public void AllocateTempMesh(ExtraVertexChannels extraChannels, int vertexCount, int indexCount, out UIMesh mesh)

Parameters

extraChannels


vertexCount


indexCount


mesh

Remarks

Pass
vertexCount
= 0 to skip the vertex+extras allocation, or
indexCount
= 0 to skip the index allocation. Channels not requested are returned as default (empty) slices.