The number of sub-meshes inside the Mesh object.
Each sub-mesh corresponds to a Material in a Renderer, such as MeshRenderer or SkinnedMeshRenderer. A sub-mesh consists of a list of triangles, which refer to a set of vertices. Vertices can be shared between multiple sub-meshes. See Also: GetTriangles, SetTriangles.
function Start() { var mesh : Mesh = GetComponent.<MeshFilter>().mesh; Debug.Log("Submeshes: " + mesh.subMeshCount); }
no example available in C#
Did you find this page useful? Please give it a rating: