private IEnumerator waitAndCheckIfPreSpawn() { yield return(new WaitForSeconds(1f)); if (true) // Modified to this since we dont have menus or anything currently. { for (int i = 0; i < this.activePoolManagers.Count; i++) { TypePoolManager poolManager = this.activePoolManagers[i]; if (poolManager != null) { if (poolManager.CheckIfPreSpawnIsEnabled()) { poolManager.ClearPool(); poolManager.PreSpawnPoolObjects(); } else { poolManager.ClearPool(); } } } } else { for (int i = 0; i < this.activePoolManagers.Count; i++) { TypePoolManager poolManager = this.activePoolManagers[i]; if (poolManager != null) { poolManager.ClearPool(); } } } }
public void ClearAllPools() { if (this.activePoolManagers != null) { for (int i = 0; i < this.activePoolManagers.Count; i++) { TypePoolManager poolManager = this.activePoolManagers[i]; if (poolManager != null) { poolManager.ClearPool(); } } } }