Пример #1
0
    /*
     * Spawning enemies with the get method getHowManyEnemies().
     * Using a coroutine that waits a given number of seconds, getSpawnInterval(), before executing again.
     * Quaternion.identity basically means just use the starting rotation, nothing being manipulated.
     */

    private IEnumerator SpawnEntireWave(WaveControllerScript p_waveControllerScript)
    {
        for (int i = 0; i < p_waveControllerScript.getHowManyEnemies(); i++)
        {
            var local_spawnNewEnemy = Instantiate(p_waveControllerScript.GetEnemy(), p_waveControllerScript.getAllPassages()[0].transform.position, Quaternion.identity);
            local_spawnNewEnemy.GetComponent <EnemyPathway>().SetWaveController(p_waveControllerScript);
            yield return(new WaitForSeconds(p_waveControllerScript.getSpawnInterval()));
        }
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     field_transform_passages = field_waveControllerScript.getAllPassages();
     transform.position       = field_transform_passages[field_int_passagesIndex].transform.position;
 }