/// See: offmeshlinks (view in online documentation for working links)
/// </summary>
publicinterfaceIOffMeshLinkHandler{
/// <summary>
/// Name of the handler.
/// This is used to identify the handler in the inspector.
/// </summary>
publicstringname=>null;
#ifMODULE_ENTITIES
/// <summary>
/// Called when an agent starts traversing an off-mesh link.
///
/// This can be used to perform any setup that is necessary for the traversal.
///
/// Returns: An object which will be used to control the agent for the full duration of the link traversal.
///
/// For simple cases, you can often implement <see cref="IOffMeshLinkHandler"/> and <see cref="IOffMeshLinkStateMachine"/> in the same class, and then
/// just make this method return this.
/// For more complex cases, you may want to keep track of the agent's identity, and thus want to return a new object for each agent that traverses the link.
/// </summary>
/// <param name="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 for this method call. Do not store it and use it later.</param>
/// Called when an agent fails to finish traversing an off-mesh link.
///
/// This can be used to perform any cleanup that is necessary after the traversal.
///
/// An abort can happen if the agent was destroyed while it was traversing the link. It can also happen if the agent was teleported somewhere else while traversing the link.
///
/// Either <see cref="OnFinishTraversingOffMeshLink"/> or <see cref="OnAbortTraversingOffMeshLink"/> will be called, but not both.
///
/// Warning: When this is called, the agent may already be destroyed. The handler component itself could also be destroyed at this point.
/// </summary>
voidOnAbortTraversingOffMeshLink(){}
}
/// <summary>
/// Connects two nodes using an off-mesh link.
/// In contrast to the <see cref="NodeLink"/> component, this link type will not connect the nodes directly
/// instead it will create two link nodes at the start and end position of this link and connect
/// through those nodes.
///
/// If the closest node to this object is called A and the closest node to the end transform is called
/// D, then it will create one link node at this object's position (call it B) and one link node at
/// the position of the end transform (call it C), it will then connect A to B, B to C and C to D.
///
/// This link type is possible to detect while following since it has these special link nodes in the middle.
/// The link corresponding to one of those intermediate nodes can be retrieved using the <see cref="GetNodeLink"/> method
/// which can be of great use if you want to, for example, play a link specific animation when reaching the link.
/// See: offmeshlinks (view in online documentation for working links)
/// See: The example scene RecastExample2 contains a few links which you can take a look at to see how they are used.
///
/// Note: If you make any modifications to the node link's settings after it has been created, you need to call the <see cref="Apply"/> method in order to apply the changes to the graph.
/// The connection will be this times harder/slower to traverse.
///
/// A cost factor of 1 means that the link is equally expensive as moving the same distance on the normal navmesh. But a cost factor greater than 1 means that it is proportionally more expensive.
///
/// You should not use a cost factor less than 1 unless you also change the <see cref="AstarPath.heuristicScale"/> field (A* Inspector -> Settings -> Pathfinding) to at most the minimum cost factor that you use anywhere in the scene (or disable the heuristic altogether).
/// This is because the pathfinding algorithm assumes that paths are at least as costly as walking just the straight line distance to the target, and if you use a cost factor less than 1, that assumption is no longer true.
/// What then happens is that the pathfinding search may ignore some links because it doesn't even think to search in that direction, even if they would have lead to a lower path cost.
///
/// Warning: Reducing the heuristic scale or disabling the heuristic can significantly increase the cpu cost for pathfinding, especially for large graphs.
///
/// Read more about this at https://en.wikipedia.org/wiki/Admissible_heuristic.
/// </summary>
publicfloatcostFactor=1.0f;
/// <summary>Make a one-way connection</summary>
publicbooloneWay=false;
/// <summary>
/// The tag to apply to the link.
///
/// This can be used to exclude certain agents from using the link, or make it more expensive to use.
///
/// See: tags (view in online documentation for working links)
/// </summary>
publicPathfindingTagpathfindingTag=0;
/// <summary>
/// Which graphs this link is allowed to connect.
///
/// The link will always connect the nodes closest to the start and end points on the graphs that it is allowed to connect.
/// Returns the link component associated with the specified node.
/// Returns: The link associated with the node or null if the node is not a link node, or it is not associated with a <see cref="NodeLink2"/> component.
/// </summary>
/// <param name="node">The node to get the link for.</param>
/// This will be true if the link has been successfully connected to the graph, and false if it either has failed, or if the component/gameobject is disabled.
///
/// When the component is enabled, the link will be scheduled to be added to the graph, it will not take effect immediately.
/// This means that this property will return false until the next time graph updates are processed (usually later this frame, or next frame).
/// To ensure the link is refreshed immediately, you can call <see cref="AstarPath.active.FlushWorkItems"/>.
/// Warning: Off-mesh links can be destroyed or disabled at any moment. The built-in code will attempt to make the agent continue following the link even if it is destroyed,
/// but if you write your own traversal code, you should be aware of this.
///
/// You can alternatively set the corresponding property property on the agent (<see cref="FollowerEntity.onTraverseOffMeshLink"/>) to specify a callback for a all off-mesh links.
///
/// Note: The agent's off-mesh link handler takes precedence over the link's off-mesh link handler, if both are set.
///
/// Warning: This property only works with the <see cref="FollowerEntity"/> component. Use <see cref="RichAI.onTraverseOffMeshLink"/> if you are using the <see cref="RichAI"/> movement script.
///
/// See: offmeshlinks (view in online documentation for working links) for more details and example code