MasterObjectPooler2
MasterObjectPooler2 copied to clipboard
Improve compatibility with fast enter playmode
Currently, the pool is initialized/cleansed on EditorApplication.playModeStateChanged for the case EnteredPlayMode
This can be somewhat problematic, as if GetObject is called on the first frame of the game, this happens before the event, and thus the pool won't be cleansed yet (resulting in warnings about null objects in the pool)
Furthermore, this means the auto initialize option actually takes a frame too long to kick in, which means that IPoolables may not be initialized
The first problem can be remedied by moving the cleanse into ExitingEditMode, not sure about the second