Version: 2017.2

Mesh.GetTriangles

切换到手册
public void GetTriangles (List<int> triangles, int submesh);
public int[] GetTriangles (int submesh);

参数

triangles 要填充的顶点索引的列表。
submesh The sub mesh on this instance. See subMeshCount.

描述

Gets the triangle list for the specified sub mesh on this instance.

Each element value in the returned triangle list refers to a vertex index, which can be used to index into the results of other accessors like vertices and GetVertices. It will return indices in multiples of three.

A sub mesh is simply a separate triangle list. When the mesh is rendered using multiple materials, you should ensure that there is one sub mesh per Material.

如果要控制索引缓冲区的生命周期并且需要避免在每次访问时都分配新数组,请使用 List<int> 参数调用方法重载。

另请参阅:subMeshCount