Version: 2023.2
言語: 日本語
public static void SetLinkActive (AI.NavMeshLinkInstance handle, bool value);

パラメーター

handle The link instance whose active state to modify.
value Whether agents can plan paths through, and traverse, the link. When the value is true, agents can plan paths through, and traverse, the link. Otherwise, no paths can use the link instance.

説明

Activates or deactivates the link instance. An active link instance can be traversed by agents and used to plan paths, but a deactivated link cannot.

This method changes the state of the link instance immediately. Any path that you calculate afterwards takes into account the new state of the link. When you disable the link instance any paths that have already been calculated through it get a status value of invalid.
You can call this method at any time to deactivate the link and prevent agents from moving through a section of the game level, for example through a door that connects two rooms. Conversely, you can activate the link and allow the agents to move between the respective game level sections.
Deactivated links remain connected to the NavMesh surfaces and they do not need to find the connection points again when they are reactivated.
Any link instance created with the AddLink method is active by default.

This method is available as of 2023.2.

See Also: IsLinkActive.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961