public Pool(PoolAble obj, int nbObj, int extend) { _list = new List<PoolAble>(); _extend = (extend <= 0 ? 1 : extend); _objectBase = obj; AddObject(nbObj); }
public void Push(PoolAble poolAble) { string name = poolAble.gameObject.name; if (pool.ContainsKey(name) == false) { Object.Destroy(poolAble.gameObject); return; } pool[name].Push(poolAble); }
public void Push(PoolAble poolAble) { if (poolAble == null) { return; } poolAble.transform.parent = Root; poolAble.gameObject.SetActive(false); poolAble.isUsing = false; poolStack.Push(poolAble); }
public void Destroy(GameObject obj, float time) { if (obj != null) { PoolAble poolAble = obj.GetComponent <PoolAble>(); if (poolAble != null) { Managers.Pool.Push(poolAble); return; } Object.Destroy(obj, time); } }