指定应在导航网格构建完成后将构建时生成的哪些临时数据保留在内存中。
可以在 Editor 中收集并显示使用 NavMeshBuilder 构建导航网格时所用的中间数据。当生成的导航网格形状与预期不符时,这有助于对各种问题进行诊断。
“使用调试选项构建导航网格后显示的输入几何体、区域、多边形网格细节和原始轮廓”
导航网格的计算过程包括以下几个连续步骤:\
i. 将场景的地形和网格分解为三角形;\
ii. 将输入三角形光栅化为 3D 体素表示形式并查找边缘;\
iii. 将表面的体素细分为更简单的水平区域;\
iv. 为每个区域寻找紧密贴合的轮廓;\
v. 将轮廓简化为多边形;\
vi. 根据组合起来的所有轮廓创建凸多边形网格;\
vii. 将多边形网格细化为三角网格,使其更接近场景的原始几何体。
可使用调试功能分别捕获和显示每个阶段的结果,但系统通常会在导航网格构建完成后丢弃这些结果。
这些调试数据可能会相当大,具体取决于场景的合成情况。它们以压缩形式存储在内存中,但会在显示时解压。
**注意:**
Unity 不保存调试可视化内容 - 这些内容仅在 Unity 构建导航网格的会话期间提供。
不会针对使用 the legacy system 静态烘焙的导航网格或因出现 NavMesh Obstacles 而局部重新计算的任何补丁程序显示或收集调试数据。
另请参阅:NavMeshBuildSettings、NavMeshBuilder.BuildNavMeshData、NavMeshEditorHelpers.DrawBuildDebug。
flags | 指定构建导航网格时应收集哪些类型的调试数据。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.