Closed antfarmar closed 8 years ago
Implemented with a reusable ObjectPooler static singleton class. Uses a Queue to pool Poolable type objects. Manages multiple pools per GameObject type using a Dictionary.(string key).
See the wiki entry about Pooling.
Currently uses a List<>
implemented as a Stack: O(1) complexity when removing/adding to it's end.
static
classes or variables used.
Implement a simple object pooling script for asteroid and bullet reuse, instead of constantly instantiating and destroying them (inefficient, alot of expensive gc calls).
See: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling http://answers.unity3d.com/questions/765574/can-someone-just-post-a-generic-object-pool-script.html https://theliquidfire.wordpress.com/2015/07/06/object-pooling/ (Good read!)