◆ WorkItemProcessor()
◆ AddWorkItem()
Add a work item to be processed when pathfinding is paused.
- See also
- ProcessWorkItems
◆ EnsureValidFloodFill()
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.
Implements IWorkItemContext.
◆ ProcessWorkItems()
bool ProcessWorkItems |
( |
bool |
force | ) |
|
|
private |
◆ ProcessWorkItemsForScan()
bool ProcessWorkItemsForScan |
( |
bool |
force | ) |
|
Process graph updating work items.
Process all queued work items, e.g graph updates and the likes.
- Returns
- false if there are still items to be processed.
- true if the last work items was processed and pathfinding threads are ready to be resumed.
- See also
- AddWorkItem
-
threadSafeUpdateState
-
Update
◆ ProcessWorkItemsForUpdate()
bool ProcessWorkItemsForUpdate |
( |
bool |
force | ) |
|
Process graph updating work items.
Process all queued work items, e.g graph updates and the likes.
- Returns
- false if there are still items to be processed.
- true if the last work items was processed and pathfinding threads are ready to be resumed.
- See also
- AddWorkItem
-
threadSafeUpdateState
-
Update
This method also calls GraphModifier.TriggerEvent(PostUpdate) if any graphs were dirtied. It also calls EnsureValidFloodFill after the work items are done
◆ QueueFloodFill()
void IWorkItemContext. QueueFloodFill |
( |
| ) |
|
|
private |
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.
- Deprecated:
- This method no longer does anything.
Implements IWorkItemContext.
◆ SetGraphDirty()
void IWorkItemContext. SetGraphDirty |
( |
NavGraph |
graph | ) |
|
|
private |
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.
Implements IWorkItemContext.
◆ anyGraphsDirty
bool anyGraphsDirty = true |
|
private |
◆ astar
◆ workItems
◆ anyQueued
True if any work items are queued right now.
◆ workItemsInProgress
True while a batch of work items are being processed.
Set to true when a work item is started to be processed, reset to false when all work items are complete.
Work item updates are often spread out over several frames, this flag will be true during the whole time the updates are in progress.
◆ workItemsInProgressRightNow
bool workItemsInProgressRightNow |
|
getprivate set |
Used to prevent waiting for work items to complete inside other work items as that will cause the program to hang.
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/Misc/WorkItemProcessor.cs