Function AstarPath.PausePathfinding
PausePathfinding
()
Blocks until all pathfinding threads are paused and blocked.
Public
PathProcessor.GraphUpdateLock PausePathfinding ()
Blocks until all pathfinding threads are paused and blocked.
var graphLock = AstarPath.active.PausePathfinding();
// Here we can modify the graphs safely. For example by increasing the penalty of a node
AstarPath.active.data.gridGraph.GetNode(0, 0).Penalty += 1000;
// Allow pathfinding to resume
graphLock.Release();
Return
A lock object. You need to call Release on that object to allow pathfinding to resume.
Note
In most cases this should not be called from user code. Use the AddWorkItem method instead.
See