public void Despawn(GameObject obj, AP_Reference oprScript) // return an object back to this pool { if (obj.transform.parent == transform) { return; } // already in pool obj.SetActive(false); obj.transform.parent = transform; obj.transform.localPosition = Vector3.zero; obj.transform.localRotation = Quaternion.identity; oprScript.CancelInvoke(); pool.Push(new PoolItem(obj, oprScript)); }