Function AstarData.LockGraphStructure

LockGraphStructure (bool allowAddingGraphs=…)

Prevent the graph structure from changing during the time this lock is held.

Internal
void LockGraphStructure (

bool

allowAddingGraphs=false

)

Prevent the graph structure from changing during the time this lock is held.

This prevents graphs from being added or removed and also prevents graphs from being serialized or deserialized. This is used when e.g an async scan is happening to ensure that for example a graph that is being scanned is not destroyed.

Each call to this method *must* be paired with exactly one call to UnlockGraphStructure. The calls may be nested.