Skip to content

Instantly share code, notes, and snippets.

@RichLogan
Last active June 7, 2016 14:27
Show Gist options
  • Save RichLogan/b7b1f4f214d47e7f2145c984acbe6860 to your computer and use it in GitHub Desktop.
Save RichLogan/b7b1f4f214d47e7f2145c984acbe6860 to your computer and use it in GitHub Desktop.
Dynamic Meshes
_mesh = new Mesh();
_mesh.name = "Line Mesh";
_mesh.MarkDynamic();
// Some mesh manipulation occurs here
_mesh.Optimize();
_mesh.UploadMeshData(true);
Debug.Log(_mesh.isReadable); // showing false
byte[] serialised_mesh = MeshSerializer.WriteMesh(_mesh, false);
// Mesh Serializer basically reads mesh.vertices, mesh.normals etc etc.
Debug.Log(serialised_mesh.Length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment