导航网格链接 (NavMesh Link) 组件不在 Unity 标准安装中;有关如何访问该组件的信息,请参阅高级导航网格构建组件的文档。
导航网格链接在使用导航网格的两个位置之间创建可导航的链接。
此链接可以是点到点,也可以跨越间隙,在后一种情况下,代理 (Agent) 使用沿着入口边缘的最近位置来跨越链接。
必须使用导航网格链接来连接不同的导航网格表面。
要使用导航网格链接组件,请导航至 GameObject > AI > NavMesh Link。
属性 | 功能 |
---|---|
Agent Type | 可使用该链接的代理类型。 - Humanoid - Ogre |
Start Point | 链接起点(相对于游戏对象)。由 XYZ 测量值定义。 |
End Point | 链接终点(相对于游戏对象)。由 XYZ 测量值定义。 |
Align Transform To Points | 单击此按钮可将游戏对象移到链接的中心点,并将变换的前向轴与终点对齐。 |
Bidirectional | 选中此复选框时,导航网格代理 (NavMesh Agent) 会双向遍历导航网格链接(从起点到终点,再从终点回到起点)。 取消选中此复选框时,导航网格链接仅单向运行(仅从起点到终点)。 |
Area Type | 导航网格链接的区域类型(这会影响寻路成本)。 - Walkable__(这是默认选项) - Not Walkable__ - Jump |
如果希望代理在场景中的多个导航网格表面之间移动,必须使用导航网格链接连接它们。
在上面的示例场景中,蓝色和红色导航网格在不同的导航网格表面中定义,并使用导航网格链接连接它们。
注意在连接导航网格表面时:
可使用多个导航网格链接来连接导航网格表面。
导航网格表面和导航网格链接都必须具有相同的代理类型。
导航网格链接的起点和终点只能在一个导航网格表面上;如果在同一位置有多个导航网格,请务必小心。
如果要加载第二个导航网格表面,并在第一个场景中有未连接的导航网格链接,请确保它们未连接到任何不需要的导航网格表面。
2017–05–26 页面已发布
5.6 中的新功能
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.