OffMeshLink 组件允许您合并无法使用可行走表面来表示的导航捷径。例如,跳过沟渠或围栏,或在通过门之前打开门,全都可以描述为网格外链接。
属性 | 功能 |
---|---|
Start | 描述网格外链接起始位置的对象。 |
End | 描述网格外链接起始位置的对象。 |
Cost Override | 如果值为正,则在计算处理路径请求的路径成本时使用该值。否则,使用默认成本(此游戏对象所属区域的成本)。如果 Cost Override 设置为值 3.0,则在网格外链接上移动的成本将是在默认导航网格区域上移动相同距离的成本的三倍。如果希望让代理通常优先选择步行,但当步行距离明显更长时使用网格外链接,则 Cost Override 设置将变得有用。 |
Bi-Directional | 如果启用此属性,则可以在任一方向上遍历链接。否则,只能按照从 Start 到 End 的方向遍历链接。 |
Activated | 指定寻路器 (pathfinder) 是否将使用此链接(如果将此属性设置为 false,则将忽略它)。 |
Auto Update Positions | 如果启用此属性,当端点移动时,网格外链接将重新连接到导航网格。如果禁用,即使移动了端点,链接也将保持在其起始位置。 |
Navigation Area | 描述链接的导航区域类型。该区域类型允许您对相似区域类型应用常见的遍历成本,并防止某些角色根据代理的区域遮罩 (Area Mask) 访问网格外链接。 |
如果代理未遍历网格外链接,请确保两个端点都已正确连接。正确连接的端点应在接入点周围显示一个圆圈。
另一个常见原因是导航网格代理 (Navmesh Agent) 的 Area Mask 没有包含网格外链接的区域。
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.