NavMeshBuildDebugSettings

struct in UnityEngine.AI

Switch to Manual

Description

指定应在导航网格构建完成后将构建时生成的哪些临时数据保留在内存中。

可以在 Editor 中收集并显示使用 NavMeshBuilder 构建导航网格时所用的中间数据。当生成的导航网格形状与预期不符时,这有助于对各种问题进行诊断。

“使用调试选项构建导航网格后显示的输入几何体、区域、多边形网格细节和原始轮廓”

The process for computing a NavMesh comprises of several sequential steps:
i. decomposing the Scene's terrain and meshes into triangles;
ii. rasterizing the input triangles into a 3D voxel representation and finding ledges;
iii. partitioning the voxels lying at the surface into simpler horizontal regions;
iv. finding a tight-fitting contour for each of these regions;
v. simplifying the contours into polygonal shapes;
vi. creating a mesh of convex polygons based on all the contours combined;
vii. refining the polygonal mesh into a triangulated version that approximates better the Scene's original geometry.

可使用调试功能分别捕获和显示每个阶段的结果,但系统通常会在导航网格构建完成后丢弃这些结果。

Depending on the Scene composition this debug data can be considerably large in size. It is stored in memory in a compressed manner but gets further expanded when being displayed.

注意:
1.Unity 不保存调试可视化内容 - 这些内容仅在 Unity 构建导航网格的会话期间提供。
2.不会针对使用 the legacy system 静态烘焙的导航网格或因出现 NavMesh Obstacles 而局部重新计算的任何补丁程序显示或收集调试数据。

另请参阅:NavMeshBuildSettingsNavMeshBuilder.BuildNavMeshDataNavMeshEditorHelpers.DrawBuildDebug

Variables

flags指定构建导航网格时应收集哪些类型的调试数据。