Object Pool


In an attempt to make my current and future Unity games more efficient I developed an Object Pooling runtime utility, so rather than instantiating and destroying objects as they’re needed, the object pool will recycle existing objects as they’re no longer required. For the sake of convenience the Object Pool class is based off of the Singleton pattern, so to use it you don’t actually have to place a Game Object with the Object Pool component on it in a scene to use it. However, if you want to pre-load the Object Pool with prefabs you can, this does require you to manually place a Game Object with the Object Pool component on it in the scene in order to populate it in the hierarchy window.

For the sake of convenience, the Object Pool class uses functions that are almost parallel to Unity’s Destroy and Instantiate functions. So rather than using ‘GameObject.Instantiate’ you use ‘ObjectPool.Spawn’, with the new function returning a GameObject and its arguments mirroring those of the default Instantiate function. As for the ‘Destroy’ function, you can instead use ‘ObjectPool.Deactivate’, this function has two different sets of arguments, the default being to deactivate the specified object immediately, and the other being to deactivate it after a defined number of seconds.

Asset Store Page

NGUI Add-on: Color-Blind Utility

Color-Blind Utility

I recently wrote a simple Color-Blind Utility for NGUI: Next-Gen UI, the add-on allows you to assign alternate colors and sprites from an atlas to UISprites, as well as colors and fonts to UILabels (including those targeted by a UIButton’s color tweening). This add-on also includes a color-blind simulation post-processing effect to be used for testing purposes (Requires Unity Pro License). I designed the add-on in such a way that it should integrate fairly seamlessly into the pre-existing NGUI toolset and be easily modifiable from an API level, making it easy to integrate into a game’s settings menu.

Asset Store Link: https://www.assetstore.unity3d.com/en/#!/content/17418