bool
UpdateGraphsNoBlock (

Nodes which should have valid paths between them. All nodes should be walkable or false will be returned.

bool

alwaysRevert=false

If true, reverts the graphs to the old state even if no blocking occurred

)

Updates graphs and checks if all nodes are still reachable from each other.

Graphs are updated, then a check is made to see if the nodes are still reachable from each other. If they are not, the graphs are reverted to before the update and false is returned. This is slower than a normal graph update. All queued graph updates will be flushed during this function.

bool
UpdateGraphsNoBlock (

Node which should have a valid path to node1. All nodes should be walkable or false will be returned.

bool

alwaysRevert=false

If true, reverts the graphs to the old state even if no blocking occurred

)

Updates graphs and checks if all nodes are still reachable from each other.

Graphs are updated, then a check is made to see if the nodes are still reachable from each other. If they are not, the graphs are reverted to before the update and false is returned.
This is slower than a normal graph update. All queued graph updates and thread safe callbacks will be flushed during this function.

if (GraphUpdateUtilities.UpdateGraphsNoBlock(guo, spawnPointNode, goalNode, false)) { // Valid tower position // Since the last parameter (which is called "alwaysRevert") in the method call was false // The graph is now updated and the game can just continue} else { // Invalid tower position. It blocks the path between the spawn point and the goal // The effect on the graph has been reverted Destroy(tower);}