// Check what seems to be fastest, to update the union of prevBounds and newBounds in a single request
// or to update them separately, the smallest volume is usually the fastest
if (BoundsVolume(merged) < BoundsVolume(newBounds) + BoundsVolume(prevBounds))
{
// Send an update request to update the nodes inside the 'merged' volume
AstarPath.active.UpdateGraphs(merged);
}
else
{
// Send two update request to update the nodes inside the 'prevBounds' and 'newBounds' volumes
AstarPath.active.UpdateGraphs(prevBounds);
if (newBounds.extents != Vector3.zero)
AstarPath.active.UpdateGraphs(newBounds);
}
Update 3:
I removed DoUpdateGraphs(); from OnEnable() and it no longer freezes on startup, but can still permanently lockup the editor with the same pattern of errors later on.
It seems that AstarPath.active.UpdateGraphs is broken in this scenario in the latest version of the editor, and the only way around it is to not call that function