Pool Extension

$9
Publisher Creative Spore
File size 424.88kB
Number of files 14
Latest version 1
Latest release date 2019-03-12 10:57:11
First release date 2018-09-28 05:48:09
Supported Unity versions 2018.4.2 or higher
Compatible with Unity 2017 & 2018!

Pool Extension is just an extension for Unity.Component that will extend the Unity methods Instantiate and Destroy to use a pool instead of creating and destroying gameObjects all the time, reducing the garbage memory allocation and improving the performance.

The same Unity events will be called for reused gameObjects (Awake, Start, Destroy) and you can restore prefabs properties and fields using the special attributes [PoolRestoreValue] and [PoolRestoreAllValues]

Manual | API Doc. | Forum

FEATURES

Easy Setup and Use

Instead of Instantiate or Destroy, use this.PoolInstantiate and this.PoolDestroy.

Examples:

   ♻ Instanciate(bulletPrefab, transform.position, transform.rotation) ➡ this.PoolInstanciate(bulletPrefab, transform.position, transform.rotation)
   ♻ Destroy(this.gameObject, 4f) ➡ this.PoolDestroy(this.gameObject, 4f)


If you want to restore a field or property from the prefab in a custom Monobehaviour, use the attribute [PoolRestoreValue] before the field or property, and use [PoolRestoreAllValues] before the Monobehaviour class to restore all the properties and fields in the Monobehaviour.

Examples:

   [PoolRestoreValue] public int Lives { get{ return m_lives;} set{ m_lives = value; } };
   [PoolRestoreValue] private int m_lives = 3;
   [PoolRestoreAllValues]
   public class Enemy : Monobehaviour
   {
   }


Extras:
    ♻ PoolAudioSource.PlayClipAtPoint & PoolAudioSource.PlayClipAtPoint2D: enhanced versions of AudioSource.PlayClipAtPoint using the pool extension.

Great Support: If you need help with something, just contact the support email or forum.

Support: [email protected]
Web: www.creativespore.com
Twitter: https://twitter.com/CreativeSpore

Top Publisher Assets