Пример #1
0
    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++;
    }
Пример #2
0
    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());
    }