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

Number of nodes in the graph.

NearestNodeDistanceSqrLowerBound (position, constraint=null)

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

OnDrawGizmos (gizmos, drawNodes, redrawScope)

Draw gizmos for the graph.

Public Variables

isScanned

True if the graph has been scanned and contains nodes.

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

Inherited Public Members

GetNearest (position, [...])

...

GetNodes (action)

IsInsideBounds (point)

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

IsPointOnNavmesh (position)

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

RandomPointOnSurface (nnConstraint, highQuality=true)

A random point on the graph.

RelocateNodes (deltaMatrix)

Moves the nodes in this graph.

Scan ()

Scan the graph.

Snapshot (bounds)

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

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 ()

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

Deserializes graph type specific node data.

Destroys all nodes in the graph.

DirtyBounds (bounds)

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

Cleans up any unmanaged data that the graph has.

DrawUnwalkableNodes (gizmos, size, redrawScope)

Function for cleaning up references.

Called after all deserialization has been done for all graphs.

RemoveNode (node)
ScanInternal ([...])

Internal method to scan the graph.

Serializes graph type specific node data.

exists

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

Internal
nodeCount
Private
nodes
Private