Version: 2022.2

NavMeshBuildSettings

struct in UnityEngine.AI

切换到手册

描述

NavMeshBuildSettings 结构可用于指定一系列设置,这些设置描述了特定 agent 类型的尺寸和限制。

如果游戏中的角色在高度、宽度或攀爬能力方面差别很大,您可能需要定义多个 NavMeshBuildSettings。

您还可以使用此结构设置体素和区块大小,从而控制构建过程中的精度和粒度。某些值是耦合关系,即有些值会基于其他值而受到限制。例如,如果 agentClimb 大于 agentHeight,则无效。 若要诊断这些规则的违反情况,可以利用特殊方法 ValidationReport 进行评估。

变量

agentClimbAgent 的最大垂直步长。
agentHeight用于烘焙的 agent 高度(以世界单位表示)。
agentRadius用于烘焙的 agent 半径(以世界单位表示)。
agentSlope可行走的最大倾斜角(以度为单位)。
agentTypeID将为其烘焙导航网格的 agent 类型 ID。
buildHeightMeshEnables the creation of additional data needed to determine the height at any position on the NavMesh more accurately.
debug构建期间用于收集调试数据的选项。
ledgeDropHeightMaximum agent drop height.
maxJobWorkersThe maximum number of worker threads that the build process can utilize when building a NavMesh with these settings.
maxJumpAcrossDistanceMaximum agent jump distance.
minRegionArea各个导航网格区域的近似最小面积。
overrideTileSize启用覆盖默认区块大小的功能。另请参阅:tileSize。
overrideVoxelSize启用覆盖默认体素大小的功能。另请参阅:voxelSize。
tileSize设置区块大小(以体素为单位)。
voxelSize设置体素大小(以世界长度为单位)。

公共函数

ValidationReport验证 NavMeshBuildSettings 的属性。