private void Start() { waypoints = waveConfig.GetWaypoints(); gameSession = FindObjectOfType <GameSession>(); transform.position = CurrentPosition(); ResetShotCounter(); laserMotion.y -= laserSpeed; }
private IEnumerator SpawnAllEnemiesInWave(Waveconfig waveConfig) { for (int index = 0; index < waveConfig.GetNumberOfEnemies(); index++) { var newEnemy = Instantiate( waveConfig.GetEnemyPrefab(), waveConfig.GetWaypoints()[0].transform.position, Quaternion.identity); newEnemy.GetComponent <Enemy>().SetWaveConfig(waveConfig); yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawns())); } }