Class LinkGraph Extends NavGraph

Public

Graph for off-mesh links.

This is an internal graph type which is used to store off-mesh links. An off-mesh link between two nodes A and B is represented as:A <--> N1 <--> N2 <--> B
. where N1 and N2 are two special nodes added to this graph at the exact start and endpoints of the link.

This graph is not persistent. So it will never be saved to disk and a new one will be created each time the game starts.

It is also not possible to query for the nearest node in this graph. The GetNearest method will always return an empty result. This is by design, as all pathfinding should start on the navmesh, not on an off-mesh link.

Inner Types

Public Methods

CountNodes ()

Number of nodes in the graph.

Public
GetNearest (position, constraint, maxDistanceSqr)

It's not possible to query for the nearest node in a link graph.

Public
GetNodes (action)
Public
NearestNodeDistanceSqrLowerBound (position, constraint=null)

Lower bound on the squared distance from the given point to the closest node in this graph.

Public
OnDrawGizmos (gizmos, drawNodes, redrawScope)

Draw gizmos for the graph.

Public

Public Variables

isScanned
Public
persistent
Public
showInInspector
Public

Inherited Public Members

GetNearest (position, constraint=null)

Returns the nearest node to a position using the specified NNConstraint.

Public
GetNodes (action)

Calls a delegate with all nodes in the graph until the delegate returns false.

Public
IsInsideBounds (point)

True if the point is inside the bounding box of this graph.

Public
IsPointOnNavmesh (position)

True if the point is on a walkable part of the navmesh, as seen from above.

Public
RelocateNodes (deltaMatrix)

Moves the nodes in this graph.

Public
Scan ()

Scan the graph.

Public
Snapshot (bounds)

Captures a snapshot of a part of the graph, to allow restoring it later.

Public
active

Reference to the AstarPath object in the scene.

Public
bounds

World bounding box for the graph.

Public
drawGizmos

Enable to draw gizmos in the Unity scene view.

Public
graphIndex

Index of the graph, used for identification purposes.

Public
guid

Used as an ID of the graph, considered to be unique.

Public
infoScreenOpen

Used in the editor to check if the info screen is open.

Public
initialPenalty

Default penalty to apply to all nodes.

Public
name

Name of the graph.

Public
open

Is the graph open in the editor.

Public
persistent

True if the graph will be included when serializing graph data.

Public
showInInspector

True if the graph should be visible in the editor.

Public

Private/Protected Members

AddNode ()
Internal
AssertSafeToUpdateGraph ()

Throws an exception if it is not safe to update internal graph data right now.

Protected
DeserializeExtraInfo (ctx)

Deserializes graph type specific node data.

Protected
DestroyAllNodes ()

Destroys all nodes in the graph.

Protected
DirtyBounds (bounds)

Notifies the system that changes have been made inside these bounds.

Protected
DisposeUnmanagedData ()

Cleans up any unmanaged data that the graph has.

Protected
DrawUnwalkableNodes (gizmos, size, redrawScope)
Protected
OnDestroy ()

Function for cleaning up references.

Protected
PostDeserialization (ctx)

Called after all deserialization has been done for all graphs.

Protected
RemoveNode (node)
Internal
ScanInternal (async)

Internal method to scan the graph.

Protected
SerializeExtraInfo (ctx)

Serializes graph type specific node data.

Protected
exists

True if the graph exists, false if it has been destroyed.

Internal
nodeCount
Private
nodes
Private

Deprecated Members

ScanInternal ()

Internal method to scan the graph.

Protected