Class NavGraph Extends IGraphInternals

Public Abstract

Base class for all graphs.

Public Methods

CountNodes ()

Number of nodes in the graph.

Public
GetNearest (position, constraint=null)

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

Public
GetNearest (position, constraint, maxDistanceSqr)

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

Calls a delegate with all nodes in the graph.

Public Abstract
IsInsideBounds (point)

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

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

Moves the nodes in this graph.

Public
Scan ()

Scan the graph.

Public

Public Variables

active

Reference to the AstarPath object in the scene.

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
isScanned

True if the graph has been scanned and contains nodes.

Public Abstract
name

Name of the graph.

Public
open

Is the graph open in the editor.

Public

Private/Protected Members

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
DeserializeExtraInfo (ctx)
Private
DestroyAllNodes ()

Destroys all nodes in the graph.

Protected
DestroyAllNodes ()
Private
DisposeUnmanagedData ()

Cleans up any unmanaged data that the graph has.

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

Function for cleaning up references.

Protected
OnDestroy ()
Private
PostDeserialization (ctx)

Called after all deserialization has been done for all graphs.

Protected
PostDeserialization (ctx)
Private
ScanInternal (async)

Internal method to scan the graph.

Protected
ScanInternal (async)
Private
SerializeExtraInfo (ctx)

Serializes graph type specific node data.

Protected
SerializeExtraInfo (ctx)
Private
SerializedEditorSettings
Private
exists

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

Internal
serializedEditorSettings

Used in the Unity editor to store serialized settings for graph inspectors.

Private

Deprecated Members

GetNearestForce (position, constraint)

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

Public
RelocateNodes (oldMatrix, newMatrix)

Moves nodes in this graph.

Public
ScanGraph ()

Scan the graph.

Public
ScanInternal ()

Internal method to scan the graph.

Protected
SetMatrix (m)

Use to set both matrix and inverseMatrix at the same time.

Public
inverseMatrix

Inverse of matrix.

Public
matrix

A matrix for translating/rotating/scaling the graph.

Public