用于访问烘焙导航网格的单例类。
Use the NavMesh class to perform spatial queries such as pathfinding and walkability tests. This class also lets you set the pathfinding cost for specific area types, and tweak the global behavior of pathfinding and avoidance.
Before you can use spatial queries, you must first bake the NavMesh to your scene.
另请参阅:\
• 构建导航网格 – 了解有关如何设置和烘焙导航网格的更多信息\
• 区域和成本 – 了解如何使用不同的区域类型。\
• NavMeshAgent – 了解如何控制和移动导航网格代理。\
• NavMeshObstacle – 了解如何使用脚本控制导航网格障碍物。\
• OffMeshLink – 了解如何使用脚本控制网格外链接。\
AllAreas | 包含所有导航网格区域的区域遮罩常量。 |
avoidancePredictionTime | 描述代理在未来多久后预测碰撞,以便进行规避。 |
onPreUpdate | 设置一个要在执行帧更新期间且在导航网格更新之前调用的函数。 |
pathfindingIterationsPerFrame | The maximum number of nodes processed for each frame during the asynchronous pathfinding process. |
AddLink | 向导航网格添加链接。此链接由 NavMeshLinkData 结构描述。 |
AddNavMeshData | 向游戏添加指定的导航网格数据。 |
CalculatePath | 计算两点之间的路径并存储生成的路径。 |
CalculateTriangulation | 计算当前导航网格的三角形剖分。 |
CreateSettings | 创建并返回可用于运行时导航网格构建操作的导航网格构建设置新条目。 |
FindClosestEdge | 从导航网格上的一点找到最近的导航网格边缘。 |
GetAreaCost | 获取区域类型几何体的寻路成本。 |
GetAreaFromName | 返回名为导航网格区域类型的区域索引。 |
GetSettingsByID | 返回导航网格构建设置的现有条目。 |
GetSettingsByIndex | 按其有序索引返回导航网格构建设置的现有条目。 |
GetSettingsCount | 返回已注册的导航网格构建设置的数量。 |
GetSettingsNameFromID | 返回与导航网格构建设置(与提供的代理类型 ID 匹配)关联的名称。 |
Raycast | 在导航网格上的两点之间找出一条线。 |
RemoveAllNavMeshData | 从游戏中删除所有导航网格表面和链接。 |
RemoveLink | 从导航网格中删除链接。 |
RemoveNavMeshData | 从游戏中删除指定的 NavMeshDataInstance,使其无法用于代理和查询。 |
RemoveSettings | 删除与代理类型 ID 匹配的构建设置。 |
SamplePosition | Finds the nearest point based on the NavMesh within a specified range. |
SetAreaCost | 设置所有代理上的区域类型几何体的寻路成本。 |
OnNavMeshPreUpdate | 一种委托,用于注册在导航网格系统更新之前调用的回调方法。 |
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.