public void Destroy(GameObject obj) { PoolableObject pobj = obj.GetComponent <PoolableObject>(); if (pobj == null) { Debug.LogWarning("Tried to destroy an unpooled object with a pool method. Object name : " + obj.name); return; } pobj.Destroy(); }