Search Unity

[Released] 13Pixels Pooling

Discussion in 'Assets and Asset Store' started by FlaSh-G, Nov 22, 2018.

  1. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    Hi there! I just released 13Pixels Pooling in the Asset Store.


    If you haven't heard of pooling yet, the short explanation is: Instantiating and destroying objects isn't the most performant thing to do. Instantiate deserializes the entire prefab every time, and Destroy naturally produces memory garbage. Pooling means that instead of destroying objects, you disable them and put them in the recycling bin - and instead of instantiating a new object every time, the pooling system tries to recycle one first.

    I tried a few existing pooling solutions, but none of them really clicked for me. Here's a quick list of what makes this package different from others:
    • No extra setup needed. No spawn list, no folder to move the prefabs into, no SpawnManager object. I consider pooling to be a purely technical thing, so a pooling package should have a minimal footprint in editor workflow. Your scenes will not change at all when switching from Instantiate/Destroy to this package.
    • Customizable pooling behavior per prefab. By default, 13Pixels Pooling uses GameObject.SetActive to spawn and despawn pooled instances, but by implementing a very simple interface in any of the prefab's components, you can override that with anything on a per-prefab basis.
      Could your prefab just be moved under the actual scene? Or does it only have one component that needs to be disabled? Squeeze out some additional performance by letting it do so.
    • Pooled instances can be children of any object. They are not bound to be children of a pool-specific GameObject.
    Here's the user manual if you want to have a look at the workflow: http://13pixels.de/pages/assetstore/Pooling/User-Manual.pdf

    And here's the Asset Store link: http://u3d.as/1nvh

    If you start using the package and have feedback or questions, feel free to contact me! Any suggestions are welcome... and not just because I am using the package in my own projects ;)
     
    Last edited: Nov 22, 2018
    Vallar likes this.
  2. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    I just submitted an update containing a debug window that gives you more control over pooled objects for debugging.

    upload_2018-11-27_19-13-52.png