Skip to content

Commit c4c8235

Browse files
authored
Fix Triangle Count
sharedMesh.triangles returns an array of integers that are actually triplets of indices that references different vertices of the mesh. Therefore the total tri count would be the length of the array divided by 3.
1 parent 445ced1 commit c4c8235

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void OnGUI()
3131
for (int i = 0, length = meshes.Length; i < length; i++)
3232
{
3333
totalVertices += meshes[i].sharedMesh.vertexCount;
34-
totalTris += meshes[i].sharedMesh.triangles.Length;
34+
totalTris += meshes[i].sharedMesh.triangles.Length / 3;
3535
totalMeshes++;
3636
}
3737

0 commit comments

Comments
 (0)