NavMeshComponents github:  https://github.com/Unity-Technologies/NavMeshComponents#documentation-draft

1. 在场景里面创建一个新物体命名为LocalNavMeshBuilder并挂载LocalNavMeshBuilder脚本。

Unity Navigation动态烘焙 NavMeshComponents使用

2. 我们通过修改属性Sizex/y/z来设定动态烘培的范围

Unity Navigation动态烘焙 NavMeshComponents使用

Unity Navigation动态烘焙 NavMeshComponents使用

3. 我们将需要进行烘培的物体挂载NavMeshSourceTag脚本

Unity Navigation动态烘焙 NavMeshComponents使用

4. 运行即得到如下效果

Unity Navigation动态烘焙 NavMeshComponents使用

如果想在运行时修改地形那该物体也需要携带NavMeshSourceTag脚本即可。

相关文章: