Version: 2017.3

Mesh.GetIndices

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

参数

indices 要填充的索引的列表。
submesh The sub mesh on this instance. See subMeshCount.
applyBaseVertex True (default) value will apply base vertex offset to returned indices.

描述

Gets the index buffer for the specified sub mesh on this instance.

Each element value in the returned index buffer refers to a vertex index, which can be used to index into the results of other accessors like vertices and GetVertices. The layout of the indices depends on the topology of the sub mesh. For example, a triangular mesh will return indices in multiples of three.

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

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

另请参阅:subMeshCountGetTopologyMeshTopology 枚举。