struct in UnityEngine.Experimental.AI
切换到手册用于在 NavMeshWorld 中执行导航操作的对象。
与 NavMesh 相关结构中的操作相反,可以在作业(IJob、IJobParallelFor)内执行 NavMeshQuery 操作。
要获取导航网格上两个位置之间的路径,必须使用大于 0 的 pathNodePoolSize
值创建查询,并且需要按顺序调用以下方法:/BeginFindPath/、/UpdateFindPath/(必要时反复调用)、/EndFindPath/、/GetPathResult/。这些方法依赖于在 NavMeshQuery 中存储一些状态数据,但所有其他方法都不会更改对象的状态,并且可以随时调用。
在 Editor 中执行时,如果任何参数无效,则所有方法都会抛出异常。
注意:NavMeshQuery 的预期功能集还没有完全完成。
NavMeshQuery | 创建 NavMeshQuery 对象并分配内存以存储导航网格节点信息(如果需要)。 |
BeginFindPath | 在导航网格上的两个位置之间启动寻路操作。 |
CreateLocation | `返回用户提供的位置和多边形的有效 NavMeshLocation。 |
Dispose | 销毁 NavMeshQuery 并释放它使用的所有内存。 |
EndFindPath | 获取在成功的 NavMeshQuery.UpdateFindPath 操作期间计算的路径中的节点数量。 |
GetAgentTypeIdForPolygon | 返回为导航网格烘焙的或已经配置链接的代理类型的标识符。 |
GetPathResult | 复制到提供的数组中,这是构成通过 NavMeshQuery 操作找到的路径的导航网格节点的列表。 |
GetPolygonType | 返回导航网格节点是多边形还是链接。 |
GetPortalPoints | 获取两个相邻导航网格节点共有线段的端点。 |
IsValid | 如果指定 PolygonId 引用的节点在导航网格中处于活动状态,则返回 true。 |
MapLocation | 针对给定世界位置,找到导航网格上最近的点和 PolygonId。 |
MoveLocation | 将导航网格位置移动到另一个位置,且不会与表面失去接触。 |
MoveLocations | 将一系列导航网格位置移动到其他位置,且不会与表面失去接触。 |
MoveLocationsInSameAreas | 将一系列导航网格位置移动到其他位置,且不会与表面失去接触,并为所有位置给定一个公共区域过滤器。 |
PolygonLocalToWorldMatrix | 返回包含指定导航网格节点 (Read Only) 的导航网格表面的变换矩阵。 |
PolygonWorldToLocalMatrix | 返回包含指定导航网格节点 (Read Only) 的导航网格表面的反向变换矩阵。 |
Raycast | 在导航网格上的两点之间找出一条线。 |
UpdateFindPath | 继续进行正在进行的路径搜索。 |
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.