There should be a way to get the total number of indices in MeshData.
Right now the only two options are:
- GetIndexData
var indexData = meshData.GetIndexData()
var indexCount = indexData.length;
- Add up all the submeshes
int indexCount = 0;
for (int i = 0; i < meshData.subMeshCount; i++)
{
var subMesh = meshData.GetSubMesh(i);
indexCount += subMesh.indexCount;
}
The former is not ideal because it allocates a native array. The latter is not ideal because the indices in the submeshes could potentially overlap or have gaps in-between.
MeshData should just have an indexCount property which returns the length of the index data array without allocating it.