private static AnimationMesh CreateMesh(SerializableMesh meshContent) { AnimationMesh mesh = new AnimationMesh(meshContent.name); AnimationVertex[] vertices = new AnimationVertex[meshContent.vertices.Length]; for (int i = 0; i < vertices.Length; i++) { SerializableVertex vertexContent = meshContent.vertices[i]; vertices[i] = new AnimationVertex { position = vertexContent.position, normal = vertexContent.normal, texture = vertexContent.texture, blendweights = vertexContent.blendweights, blendindices = vertexContent.blendindices }; } mesh.SetIndices(meshContent.indices); mesh.SetVertices(vertices); mesh.SetTextureName(meshContent.textureName); return mesh; }
//----------------------------------------------------------------------- public void AddMesh(AnimationMesh mesh) { meshList.Add(mesh); meshIndexByName.Add(mesh.GetName(), meshList.Count - 1); }