A* Pathfinding Project
4.3.7
The A* Pathfinding Project for Unity 3D
|
Interface to expose a subset of the WorkItemProcessor functionality. More...
Interface to expose a subset of the WorkItemProcessor functionality.
Public Member Functions | |
void | EnsureValidFloodFill () |
If a WorkItem needs to have a valid area information during execution, call this method to ensure there are no pending flood fills. More... | |
void | PreUpdate () |
Call to send a GraphModifier.EventType.PreUpdate event to all graph modifiers. More... | |
void | QueueFloodFill () |
Call during work items to queue a flood fill. More... | |
void | SetGraphDirty (NavGraph graph) |
Trigger a graph modification event. More... | |
void EnsureValidFloodFill | ( | ) |
If a WorkItem needs to have a valid area information during execution, call this method to ensure there are no pending flood fills.
If you are using the Pathfinding.GraphNode.Area property or the Pathfinding.PathUtilities.IsPathPossible method in your work items, then you might want to call this method before you use them to ensure that the data is up to date.
Implemented in WorkItemProcessor.
void PreUpdate | ( | ) |
Call to send a GraphModifier.EventType.PreUpdate event to all graph modifiers.
The difference between this and GraphModifier.TriggerEvent(GraphModifier.EventType.PreUpdate) is that using this method ensures that multiple PreUpdate events will not be issued during a single update.
Once an event has been sent no more events will be sent until all work items are complete and a PostUpdate or PostScan event is sent.
When scanning a graph PreUpdate events are never sent. However a PreScan event is always sent before a scan begins.
Implemented in WorkItemProcessor.
void QueueFloodFill | ( | ) |
Call during work items to queue a flood fill.
An instant flood fill can be done via FloodFill() but this method can be used to batch several updates into one to increase performance. WorkItems which require a valid Flood Fill in their execution can call EnsureValidFloodFill to ensure that a flood fill is done if any earlier work items queued one.
Once a flood fill is queued it will be done after all WorkItems have been executed.
Implemented in WorkItemProcessor.
void SetGraphDirty | ( | NavGraph | graph | ) |
Trigger a graph modification event.
This will cause a #Pathfinding.GraphModifier.PostUpdate event to be issued after all graph updates have finished. Some scripts listen for this event. For example off-mesh links listen to it and will recalculate which nodes they are connected to when it it sent. If a graph is dirtied multiple times, or even if multiple graphs are dirtied, the event will only be sent once.
Implemented in WorkItemProcessor.