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 METHODS ////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------- public void SetVertices(AnimationVertex[] vertexArray) { this.vertices = vertexArray; isDirty = true; }