public static void DeserializeMeshNodes (NavMeshGraph graph, GraphNode[] nodes, byte[] bytes) {
System.IO.MemoryStream mem = new System.IO.MemoryStream(bytes);
System.IO.BinaryReader stream = new System.IO.BinaryReader(mem);
for (int i=0;i<nodes.Length;i++) {
TriangleMeshNode node = nodes[i] as TriangleMeshNode;
if (node == null) {
Debug.LogError ("Serialization Error : Couldn't cast the node to the appropriate type - NavMeshGenerator");
return;
}
node.v0 = stream.ReadInt32 ();
node.v1 = stream.ReadInt32 ();
node.v2 = stream.ReadInt32 ();
}
int numVertices = stream.ReadInt32 ();
graph.vertices = new Int3[numVertices];
for (int i=0;i<numVertices;i++) {
int x = stream.ReadInt32 ();
int y = stream.ReadInt32 ();
int z = stream.ReadInt32 ();
graph.vertices[i] = new Int3 (x,y,z);
}
RebuildBBTree (graph);
}