private PowerUpManager GetPowerUpManager(IEnumerable <PowerUpModel> powerUpModels) { var factory = new PickUpFactory(powerUpModels); var manager = new PowerUpManager(factory, TimeSpan.FromSeconds(10)); return(manager); }
public PowerUpManager(PickUpFactory pickUpFactory, TimeSpan minSpawnTime) { _pickUpFactory = pickUpFactory; _minSpawnTime = minSpawnTime; _lastSpawnTime = TimeSpan.Zero; _nextSpawnTime = GetNextSpawnTime(_minSpawnTime); }
void Start() { gameRunning = true; vehicleFactory = GetComponent <VehicleFactory> (); barrelFactory = GetComponent <BarrelFactory> (); pickUpFactory = GetComponent <PickUpFactory> (); pauseMenu.SetActive(false); RectTransform pauseMenuRectTransform = pauseMenu.GetComponent <RectTransform> (); pauseMenuRectTransform.offsetMax = pauseMenuRectTransform.offsetMin = new Vector2(0, 0); spawnBarrels(); spawnPlayer(); spawnWave(); // spawn first wave of enemies }