Пример #1
0
    public void StartWave(WaveManager manager)
    {
        if (end)
        {
            TransitionEffect.instance.transitionOut((Application.loadedLevel + 1) % Application.levelCount);
        }

        MusicManager.instance.playMusic(music);

        pum?.Activate();
        endWave += manager.StartNextWave;
        Sequence s = DOTween.Sequence();

        s.AppendInterval(leadtime);
        s.Append(GlobalEffects.instance.MoveCamOut(cameraZPosition, 1f));
        s.AppendCallback(() => {
            PlayCutscene();
        });
        s.AppendInterval(audioTime);
        s.AppendInterval(endTime);
        s.AppendCallback(() => {
            pum?.Deactivate();
            endWave.Invoke();
            endWave = null;
            CancelInvoke();
        });
    }
Пример #2
0
    public void StartWave(WaveManager manager)
    {
        print("start");
        if (music != null)
        {
            MusicManager.instance.playMusic(music);
        }
        endWave += manager.StartNextWave;
        Sequence s = DOTween.Sequence();

        s.Append(GlobalEffects.instance.MoveCamOut(cameraZPosition, 1f));
        s.AppendCallback(() => {
            InvokeRepeating("Spawn", spawnRate, spawnRate);
        });
        s.AppendInterval(time);
        s.AppendCallback(() => {
            endWave.Invoke();
            endWave = null;
            CancelInvoke();
        });
    }