MasterObjectPooler2 icon indicating copy to clipboard operation
MasterObjectPooler2 copied to clipboard

Improve compatibility with fast enter playmode

Open QFSW opened this issue 5 years ago • 0 comments

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

QFSW avatar Jul 22 '20 21:07 QFSW