示例#1
0
    public NavMeshModel(Vector3[] aNavMeshVertice, int[] aNavMeshIndice)
    {
        NavMeshTools.MergeVertex(aNavMeshVertice, aNavMeshIndice, out navMeshVertice, out navMeshIndice);

        InitNodes();
        InitNeighbors();

        RefreshMesh();
    }
示例#2
0
    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);
    }