It's worth noting that Game.ResetLayers calls Layer.ApplyChanges, bypassing synchronization.
Thus ResetLayers (and by extension, e.g. Game.ClearAll) can't be called while iterating the
SynchronousLists of the layers. For example, calling Game.Instance.ClearAll from the Update function of a game object will throw an exception.
On the other hand, Game.ClearGameObjects should work from anywhere with this fix.
Fixes #10.
It's worth noting that Game.ResetLayers calls Layer.ApplyChanges, bypassing synchronization. Thus ResetLayers (and by extension, e.g. Game.ClearAll) can't be called while iterating the SynchronousLists of the layers. For example, calling Game.Instance.ClearAll from the Update function of a game object will throw an exception.
On the other hand, Game.ClearGameObjects should work from anywhere with this fix.