public int[] GetTriangles (int submesh);
public int[] GetTriangles (int submesh, bool applyBaseVertex= true);
public void GetTriangles (List<int> triangles, int submesh, bool applyBaseVertex= true);
public void GetTriangles (List<int> triangles, int submesh);

Parámetros

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

Descripción

Fetches the triangle list for the specified sub-mesh on this object.

Each integer in the returned triangle list is a vertex index, which is used as an offset into the Mesh's vertex arrays. See vertices and GetVertices. The triangle list contains a multiple of three indices, one for each corner in each triangle.

A sub-mesh represents a list of triangles 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<int> 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.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961