Function IOffMeshLinkStateMachine.OnTraverseOffMeshLink
Called when an agent traverses an off-mesh link.
System.Collections.IEnumerable OnTraverseOffMeshLink (
context | Context for the traversal. Provides information about the link and the agent, as well as some helper methods for movement. This context is only valid when this coroutine steps forward. Do not store it and use it elsewhere. |
Called when an agent traverses an off-mesh link.
This method should be a coroutine (i.e return an IEnumerable) which will be iterated over until it finishes, or the agent is destroyed. The coroutine should yield null every frame until the agent has finished traversing the link.
When the coroutine completes, the agent will be assumed to have reached the end of the link and control will be returned to the normal movement code.
The coroutine typically moves the agent to the end of the link over some time, and perform any other actions that are necessary. For example, it could play an animation, or move the agent in a specific way.