/// <summary> /// Find submesh this archive/record combo will belong. /// </summary> /// <param name="mesh">Source mesh to search.</param> /// <param name="textureArchive">Texture archive value to match.</param> /// <param name="textureRecord">Texture index value to match.</param> /// <returns>Index of submesh matching this texture.</returns> private int GetSubMesh(ref PureMesh mesh, int textureArchive, int textureRecord) { for (int i = 0; i < mesh.UniqueTextures.Length; i++) { if (mesh.UniqueTextures[i].Archive == textureArchive && mesh.UniqueTextures[i].Record == textureRecord) { return(i); } } throw new Exception("GetSubMesh() index not found."); }
/// <summary> /// Find submesh this archive/record combo will belong. /// </summary> /// <param name="mesh">Source mesh to search.</param> /// <param name="textureArchive">Texture archive value to match.</param> /// <param name="textureRecord">Texture index value to match.</param> /// <returns>Index of submesh matching this texture.</returns> private int GetSubMesh(ref PureMesh mesh, int textureArchive, int textureRecord) { for (int i = 0; i < mesh.UniqueTextures.Length; i++) { if (mesh.UniqueTextures[i].Archive == textureArchive && mesh.UniqueTextures[i].Record == textureRecord) return i; } throw new Exception("GetSubMesh() index not found."); }