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.
Floodfills all graphs and updates areas for every node.
Floodfills starting from the specified node.
Floodfills starting from 'seed' using the specified area.
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 using the specified NNConstraint.
Returns the node closest to the ray (slow).
Returns the nearest node to a position using the specified NNConstraint.
Returns the nearest node to a position using the specified NNConstraint.
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 all specified graphs.
Scans a particular graph.
Scans a particular graph asynchronously.
Scans all specified graphs asynchronously.
Update all graphs within bounds.
Update all graphs using the GraphUpdateObject.
Update all graphs within bounds after delay seconds.
Update all graphs using the GraphUpdateObject after delay seconds.
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
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.
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.
Set while any graphs are being scanned.
Returns whether or not multithreading is used.
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.
Number of parallel pathfinders.
Prioritize graphs.
If true, all graphs will be scanned during Awake.
Shows or hides graph inspectors.
Toggle for showing the gizmo debugging for the 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 a new global node index.
Returns the next free path ID.
Processes graph updates.
Makes sure QueueGraphUpdates will not queue multiple graph update orders.
Debug string from the last completed path.
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.
Time the last graph update was done.
Prints path results to the log.
The next unused Path ID.
Terminates pathfinding threads when the application quits.
Clears up variables and other stuff, destroys graphs.
Cleans up meshes to avoid memory leaks.
Calls OnDrawGizmos on graph generators.
Draws the InGame debugging (if enabled), also shows the fps if 'L' is pressed down.
Handle serialization backwards compatibility.
Holds all paths waiting to be calculated and calculates them.
Holds all completed paths waiting to be returned to where they were requested.
Blocks the path queue so that e.g work items can be performed.
Stored tag names.
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.
Held if any work items are currently queued.
Processes work items.
Deprecated Members
Holds all graph data.
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.
Forces thread safe callbacks to run.
Make sure work items are executed.
Returns if any graph updates are waiting to be applied.
Batch graph updates.
Limit for how often should graphs be updated.
Defines the minimum amount of nodes in an area.
Call during work items to queue a flood fill.
Will send a callback when it is safe to update nodes.
Will send a callback when it is safe to update nodes.
Scans all graphs.
Wait for the specified path to be calculated.