Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetSubMesh(int, SubMeshDescriptor, MeshUpdateFlags)

Sets the data for a sub-mesh of the Mesh that Unity creates from the MeshData.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public void SetSubMesh(int index, SubMeshDescriptor desc, MeshUpdateFlags flags = MeshUpdateFlags.Default)

Parameters

index

The index of the sub-mesh to set data for. See subMeshCount. If you specify an out of range index, Unity throws an exception.

Sub-mesh data.

Flags controlling the function behavior. See MeshUpdateFlags.

Remarks

See Mesh.SetSubMesh for more information on setting sub-mesh data. If you call this method on a read-only MeshData, Unity throws an exception.