Function IWorkItemContext.EnsureValidFloodFill
If a WorkItem needs to have a valid area information during execution, call this method to ensure there are no pending flood fills.
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 GraphNode.Area property or the PathUtilities.IsPathPossible method in your work items, then you may want to call this method before you use them, to ensure that the data is up to date.
AstarPath.active.AddWorkItem(new AstarWorkItem((IWorkItemContext ctx) => {
// Update the graph in some way
// ...
// Ensure that connectivity information is up to date.
// This will also automatically run after all work items have been executed.
ctx.EnsureValidFloodFill();
// Use connectivity information
if (PathUtilities.IsPathPossible(someNode, someOtherNode)) {
// Do something
}
}));