private void WaveStart() { Debug.Log("current wave is: " + (stageCount + 1)); currentStage = stageList[stageCount]; musicBox.clip = currentStage.Audio; foreach (GameObject spawnerObj in currentStage) { Spawner spawner = spawnerObj.GetComponent <Spawner>(); spawner.EnableSpawner(spawner.spawnID); } stageCount++; }
void Start() { musicBox = GameObject.FindGameObjectWithTag("MusicBox").GetComponent <AudioSource>(); musicBox.clip = stageList[0].Audio; currentStage = stageList[stageCount]; foreach (ArrayOfGameObject wave in stageList) { foreach (GameObject spawner in wave) { spawner.GetComponent <Spawner>().UnitLevel = difficultyLevel; } } StartCoroutine(StageController()); }