Пример #1
0
    // Update is called once per frame
    void Update()
    {
        //WaveCount() is a getter that returns how many waves are still to spawn
        spawnTimer -= Time.deltaTime;
        if (spawnTimer <= 0 && counter.WaveCount() >= 1)
        {
            // Resets the spawnTimer and spawns an object of the Type Enemy Controller
            spawnTimer = spawnDelay;
            EnemyController newEnemy = Instantiate(enemy, spawnPoint.position, spawnPoint.rotation) as EnemyController;

            //there is only one stat manager per level and multiple spawnpoints
            // this method allows one script to manage enemies, waves and win/losing
            counter.AddEnemy();
            counter.pendingwave = true;
        }
    }