Beispiel #1
0
    public void FinishRound(bool win)
    {
        onRound = false;
        levelShadowCreator.ResetShadows();



        foreach (var effect in effectsToDestroy)
        {
            if (effect != null)
            {
                Destroy(effect.gameObject);
            }
        }

        foreach (var enemy in levelSettings.ListToManager())
        {
            enemy.gameObject.SetActive(false);
        }

        foreach (var bullet in gameBullets)
        {
            Destroy(bullet.gameObject);
        }
        gameBullets = new List <BulletBehaviour>();
        if (win)
        {
            levelSettings.AddEndedLoop();
            playerRec.isRecording = false;
            playerRec.RecordRound();


            if (levelSettings.LevelHasEnded())
            {
                soundManager.PlayLevelCompleted();
                playerMov.gameObject.SetActive(false);
                levelCamera.GlitchCameraLoop();

                levelGUI.GameSuccessUI();
            }
            else
            {
                StartRound();
            }
        }
        else
        {
            soundManager.PlayDeath();
            levelCamera.EndLevelAnimationCamera();
            playerMov.PlayerDeath();
            levelSettings.ResetLoops();
            levelGUI.GameOverUI();

            failed = true;
            playerRec.isRecording = false;
            roundPlayerRecords    = new List <RoundRecordContainer>();
        }
    }