public int[] GetIndices (int submesh);
public int[] GetIndices (int submesh, bool applyBaseVertex= true);

파라미터

submeshThe sub-mesh index. See subMeshCount.
applyBaseVertexTrue (default value) will apply base vertex offset to returned indices.

반환

int[] Array with face indices.

설명

Fetches the index list for the specified sub-mesh.

Each integer in the returned list is a vertex index, which is used as an offset into the Mesh's vertex arrays. See vertices and GetVertices. The layout of the indices depends on the MeshTopology of the sub-mesh. For example, a triangular mesh will return indices in multiples of three.

A sub-mesh represents a list of triangles (or indices with a different MeshTopology) that are rendered using a single Material. When the Mesh is used with a Renderer that has multiple materials, you should ensure that there is one sub-mesh per Material.

Call the method overload with a List parameter if you control the life cycle of the index buffer and wish to avoid allocation of a new array with every access.

See Also: subMeshCount, GetTopology, MeshTopology enum.


public void GetIndices (List<int> indices, int submesh);
public void GetIndices (List<int> indices, int submesh, bool applyBaseVertex= true);

파라미터

indicesA list of indices to populate.
submeshThe sub-mesh index. See subMeshCount.
applyBaseVertexTrue (default value) will apply base vertex offset to returned indices.

설명

Use this method overload if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.