Example #1
0
        private PowerUpManager GetPowerUpManager(IEnumerable <PowerUpModel> powerUpModels)
        {
            var factory = new PickUpFactory(powerUpModels);
            var manager = new PowerUpManager(factory, TimeSpan.FromSeconds(10));

            return(manager);
        }
Example #2
0
        public PowerUpManager(PickUpFactory pickUpFactory, TimeSpan minSpawnTime)
        {
            _pickUpFactory = pickUpFactory;

            _minSpawnTime  = minSpawnTime;
            _lastSpawnTime = TimeSpan.Zero;
            _nextSpawnTime = GetNextSpawnTime(_minSpawnTime);
        }
Example #3
0
    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
    }