示例#1
0
    public void SetTowers(List <Vector2> towerPositions)
    {
        _objectPooler.HideByTag("Tower");
        var towers = _objectPooler.GetSeveral("Tower", towerPositions.Count);

        foreach (var tower in towers)
        {
            tower.GetComponent <Tower>().ShootBullet += ShootBullet;
        }
        TowersPrepared?.Invoke(towers, towerPositions);
    }
示例#2
0
    private void CreateNewWave()
    {
        _waveCount++;
        _creatingWave = true;
        var enemyCount = UnityEngine.Random.Range(_waveCount, _waveCount + _enemyVariation);
        var enemies    = _enemyPooler.GetSeveral("Enemy", enemyCount);

        foreach (var enemy in enemies)
        {
            enemy.GetComponent <Enemy>().Waypoints = _waypoints;
            enemy.GetComponent <Enemy>().SetStats(_currentDamage, _currentHealth, _currentGold);
        }
        NewWave?.Invoke(enemies);
        IncreaseCurrentStats();
    }