NavMeshBuildSettings 结构可用于指定一系列设置,这些设置描述了特定 agent 类型的尺寸和限制。
如果游戏中的角色在高度、宽度或攀爬能力方面差别很大,您可能需要定义多个 NavMeshBuildSettings。
您还可以使用此结构设置体素和区块大小,从而控制构建过程中的精度和粒度。某些值是耦合关系,即有些值会基于其他值而受到限制。例如,如果 agentClimb 大于 agentHeight,则无效。
若要诊断这些规则的违反情况,可以利用特殊方法 ValidationReport 进行评估。
agentClimb | Agent 的最大垂直步长。 |
agentHeight | 用于烘焙的 agent 高度(以世界单位表示)。 |
agentRadius | 用于烘焙的 agent 半径(以世界单位表示)。 |
agentSlope | 可行走的最大倾斜角(以度为单位)。 |
agentTypeID | 将为其烘焙导航网格的 agent 类型 ID。 |
buildHeightMesh | Enables the creation of additional data needed to determine the height at any position on the NavMesh more accurately. |
debug | 构建期间用于收集调试数据的选项。 |
ledgeDropHeight | Maximum agent drop height. |
maxJobWorkers | The maximum number of worker threads that the build process can utilize when building a NavMesh with these settings. |
maxJumpAcrossDistance | Maximum agent jump distance. |
minRegionArea | 各个导航网格区域的近似最小面积。 |
overrideTileSize | 启用覆盖默认区块大小的功能。另请参阅:tileSize。 |
overrideVoxelSize | 启用覆盖默认体素大小的功能。另请参阅:voxelSize。 |
tileSize | 设置区块大小(以体素为单位)。 |
voxelSize | 设置体素大小(以世界长度为单位)。 |
ValidationReport | 验证 NavMeshBuildSettings 的属性。 |
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.