This library is a legacy. A more advanced object pooling system is available here.
XPool: https://github.com/mackysoft/XPool
PoolManager implements an object pool in Unity.
Unity 2018.1.0f2
First, add "MackySoft.Pooling" to using area.
using MackySoft.Pooling;
You can obtain the pool in either of the following ways.
"GetPoolSafe" automatically add a pool if there is no pool.
(PoolManager.Instance [prefab] and PoolManager.GetPool (prefab) are the same.)
Pool pool = PoolManager.Insance[prefab];
Pool pool = PoolManager.GetPool(prefab);
Pool pool = PoolManager.GetPoolSafe(prefab);
Or you can use it by caching in the following way.
Pool pool = PoolManager.AddPool(prefab);
Instances can be obtained from the pool in the following way.
GameObject ins = pool.Get(parent);
GameObject ins = pool.Get(position,rotation,parent);
var ins = pool.Get<COMPONENT_NAME>(parent);
var ins = pool.Get<COMPONENT_NAME>(position,rotation,parent);
This PoolManager recognizes inactive objects as being unused.
Destroy(pooledObject);//NO NO NO
pooledGameObject.SetActive(false);//OK with this!
During playback, the number of pooled objects is displayed.
Also, you can not change prefabs and add pools from inspector.