public NavMeshModel(Vector3[] aNavMeshVertice, int[] aNavMeshIndice) { NavMeshTools.MergeVertex(aNavMeshVertice, aNavMeshIndice, out navMeshVertice, out navMeshIndice); InitNodes(); InitNeighbors(); RefreshMesh(); }
public void ExportNavMesh() { NavMeshTriangulation navMeshTriangulation = NavMesh.CalculateTriangulation(); Vector3[] vertices = null; int[] indices = null; NavMeshTools.MergeVertex(navMeshTriangulation.vertices, navMeshTriangulation.indices, out vertices, out indices); string objContent = NavMeshTools.SerializeToObj(vertices, indices); string objPath = Path.Combine(Application.dataPath, "navmesh.obj"); File.WriteAllText(objPath, objContent); }