如何在运行时从脚本 "bake" NavMesh?
How to "bake" NavMesh from script at runtime?
如何通过脚本在运行时烘焙 NavMesh。我在 Google 中搜索但没有找到。
some rendered scene and buttons including bake
目前,Unity 没有办法在运行时烘焙 NavMesh,但 Unity 有一个实验包,允许您在运行时烘焙 NavMesh。这是一个非常稳定的包。
有 tutorials made by Brackeys 与 Unity 合作。
演示项目可用于 GitHub 的 download。您可以在其中的脚本中使用来烘焙运行时 NavMesh。
我强烈建议先观看教程。
这里还有 Unity 站点的 link 和运行时导航网格的 tutorials。
using UnityEditor.AI; //"Editor" not "Engine"
NavMeshBuilder.ClearAllNavMeshes();
NavMeshBuilder.BuildNavMesh();
非常适合在运行时烘焙 NavMesh,
因为你不能同时拥有 using
标签(UnityEditor.AI
& UnityEngine.AI
).
我创建了一个单独的脚本并将其用于烘焙 NavMesh。
我不确定它是否只适用于编辑器或构建。
如何通过脚本在运行时烘焙 NavMesh。我在 Google 中搜索但没有找到。
some rendered scene and buttons including bake
目前,Unity 没有办法在运行时烘焙 NavMesh,但 Unity 有一个实验包,允许您在运行时烘焙 NavMesh。这是一个非常稳定的包。
有 tutorials made by Brackeys 与 Unity 合作。
演示项目可用于 GitHub 的 download。您可以在其中的脚本中使用来烘焙运行时 NavMesh。
我强烈建议先观看教程。
这里还有 Unity 站点的 link 和运行时导航网格的 tutorials。
using UnityEditor.AI; //"Editor" not "Engine"
NavMeshBuilder.ClearAllNavMeshes();
NavMeshBuilder.BuildNavMesh();
因为你不能同时拥有 using
标签(UnityEditor.AI
& UnityEngine.AI
).
我创建了一个单独的脚本并将其用于烘焙 NavMesh。
我不确定它是否只适用于编辑器或构建。