What's the right way to update a graph?

I need to update my graph when my position or size of my obstacles changes. Right now, I know of two ways to do this:

  1. myAstar.active.Scan();
  2. myAstar.active.UpdateGraphs(bounds, delay);

I’m using UpdateGraphs at the moment (even for the first time that I create the graph, which I do programmatically), because Scan is very slow. UpdateGraphs is almost instantaneous, even when I pass in a bounds that encompasses my entire (400x400 node) graph. This seems to work just fine, is this the correct way to do an update? If so, is there a way to make the call to do a full graph update without passing in a bounds that eclipses the whole graph?

Thank you.

Hi

Both are valid ways to update the graph.
The first one will do the update immediately, the second one will put the graph update in a queue and process it when pathfinding threads have finished calculating their current path. So the reason that UpdateGraphs is fast is because it is not actually doing the update when you call that function, however it is guaranteed to happen before the next scheduled path request is processed (unless you specify a non-zero delay like when using UpdateGraph(bounds, delay) or if A* Inspector -> Limit Graph Updates is non-zero).