Class AstarPath Extends VersionedMonoBehaviour
Core component for the A* Pathfinding System.
This class handles all of the pathfinding system, calculates all paths and stores the info.
This class is a singleton class, meaning there should only exist at most one active instance of it in the scene.
It might be a bit hard to use directly, usually interfacing with the pathfinding system is done through the Seeker class.
Public Methods
Add a work item to be processed when pathfinding is paused.
Add a work item to be processed when pathfinding is paused.
Add a work item to be processed when pathfinding is paused.
Allocate a bunch of nodes at once.
Calls OnDrawGizmos on graph generators.
Forces graph updates to complete in a single frame.
Forces work items to complete in a single frame.
Returns the nearest node to a position.
Returns the nearest node to a position using the specified NNConstraint.
Returns the nearest node to a position using the specified NNConstraint.
Returns the node closest to the ray (slow).
Returns tag names.
Blocks until all pathfinding threads are paused and blocked.
Will apply queued graph updates as soon as possible, regardless of batchGraphUpdates.
Scans a particular graph.
Scans all specified graphs.
Scans a particular graph asynchronously.
Scans all specified graphs asynchronously.
Update all graphs within bounds after delay seconds.
Update all graphs using the GraphUpdateObject after delay seconds.
Update all graphs within bounds.
Update all graphs using the GraphUpdateObject.
Public Static Methods
Blocks until the path has been calculated.
Calculates number of threads to use.
Used outside of play mode to initialize the AstarPath object even if it has not been selected in the inspector yet.
Adds the path to a queue so that it will be calculated as soon as possible.
Public Variables
Returns if any graph updates are being calculated right now.
Returns if any graph updates are waiting to be applied.
Returns if any work items are in progress right now.
Returns whether or not multithreading is used.
Number of parallel pathfinders.
Throttle graph updates and batch them to improve performance.
Holds all graph data.
The mode to use for drawing nodes in the sceneview.
The path to debug using gizmos.
The path ID to debug using gizmos.
Holds settings for heuristic optimization.
Do a full GetNearest search for all graphs.
Minimum number of seconds between each batch of graph updates.
The distance function to use as a heuristic.
The scale of the heuristic.
Set while any graphs are being scanned.
The amount of debugging messages.
If set, the debugFloor and debugRoof values will not be automatically recalculated.
Max number of milliseconds to spend each frame for pathfinding.
Maximum distance to search for nodes.
Max Nearest Node Distance Squared.
Handles navmesh cuts.
Prioritize graphs.
If true, all graphs will be scanned during Awake.
Shows or hides graph inspectors.
Visualize graphs in the scene view (editor only).
If enabled, nodes will draw a line to their 'parent'.
Toggle to show unwalkable nodes.
Number of pathfinding threads to use.
Size of the red cubes shown in place of unwalkable nodes.
Public Static Variables
Which branch of the A* Pathfinding Project is this release.
Used by the editor to guide the user to the correct place to download updates.
Called when pathID overflows 65536 and resets back to zero.
Called on Awake before anything else is done.
Called for each graph after they have been scanned.
Called for each graph before they are scanned.
Called when any graphs are updated.
Called after scanning has completed fully.
Called for each path after searching.
Called for each path before searching.
Called after scanning.
Called before starting the scanning.
The version number for the A* Pathfinding Project.
Public Enums
Information about where the package was downloaded.
Private/Protected Members
Sets up all needed variables and scans the graphs.
Waits a moment with updating graphs.
Internal method to destroy a given node.
Returns the next free path ID.
Initializes the AstarData class.
Initializes temporary path data for a node.
Calls AstarProfiler.InitializeFastProfile.
Returns if this code is currently being exectuted inside a work item.
Prints path results to the log.
Cached NNConstraint.None to avoid unnecessary allocations.
Clears up variables and other stuff, destroys graphs.
Cleans up graphs to avoid memory leaks.
Draws the InGame debugging (if enabled)
Handle serialization backwards compatibility.
Blocks the path queue so that e.g work items can be performed.
Handle serialization backwards compatibility.
Checks if any work items need to be executed then runs pathfinding for a while (if not using multithreading because then the calculation happens in other threads) and then returns any calculated paths to the scripts that requested them.
Update all graphs using the GraphUpdateObject after delay seconds.
Does simple error checking.
Processes graph updates.
Makes sure QueueGraphUpdates will not queue multiple graph update orders.
Holds a hierarchical graph to speed up some queries like if there is a path between two nodes.
Debug string from the last completed path.
Time the last graph update was done.
The next unused Path ID.
Holds all paths waiting to be calculated and calculates them.
Holds all completed paths waiting to be returned to where they were requested.
Stored tag names.
Held if any work items are currently queued.
Processes work items.
Deprecated Members
Blocks until all pathfinding threads are paused and blocked.
If a WorkItem needs to have a valid flood fill during execution, call this method to ensure there are no pending flood fills.
Floodfills starting from the specified node.
Floodfills starting from 'seed' using the specified area.
Floodfills all graphs and updates areas for every node.
Forces thread safe callbacks to run.
Make sure work items are executed.
Returns if any graph updates are waiting to be applied.
Call during work items to queue a flood fill.
Will send a callback when it is safe to update nodes.
Wait for the specified path to be calculated.
Holds all graph data.
Batch graph updates.
Limit for how often should graphs be updated.