void OnDestroy() { isBeingDestroyed = true; ///TODO: investigate a weird error "Some objects were not cleaned up when closing the scene." Debug.Log("Destroying PoolManager"); DestroyAllObjectPools(); instance = null; }