Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MeshWriteData

Represents the vertex and index data allocated for drawing the content of a VisualElement.
Read time 1 minuteLast updated 5 days ago

Definition

public class MeshWriteData

Remarks

You can use this object to fill the values for the vertices and indices only during a callback to the _generateVisualContent delegate. Do not store the passed MeshWriteData outside the scope of _generateVisualContent as Unity could recycle it for other callbacks.

Properties

Property

Description

indexCountThe number of indices successfully allocated for VisualElement content drawing.
vertexCountThe number of vertices successfully allocated for VisualElement content drawing.

Methods

Method

Description

SetAllIndicesFills the values of the allocated indices with values copied directly from an array. Each 3 consecutive indices form a single triangle.
SetAllVerticesFills the values of the allocated vertices with values copied directly from an array. When this method is called, it is not possible to use MeshWriteData.SetNextVertex to fill the allocated vertices array.
SetNextIndexAssigns the value of the next index of the allocated indices list.
SetNextVertexAssigns the value of the next vertex of the allocated vertices list.