public void DeleteSubMesh(ushort subMeshId) { subMeshId -= SubMeshBaseIdx; SubMesh subMesh = SubMeshes[subMeshId]; FragmentedSubs.Add(subMeshId); if (subMeshId < SubMeshes.Count - 1) { SubMesh next = SubMeshes[subMeshId + 1]; SubMeshes[subMeshId] = subMesh.ResizeBuffers((ushort)(next.vertBase - subMesh.vertBase), (ushort)(next.triBase - subMesh.triBase)); } for (int i = subMesh.vertBase; i < subMesh.vertBase + subMesh.vertCount; i++) { Verts[i] = Vector3.zero; } for (int i = subMesh.triBase; i < subMesh.triBase + subMesh.triCount; i++) { Tris[i] = subMesh.vertBase; } }