예제 #1
0
    private IEnumerator DoCringe(bool endCringe)
    {
        currentGameState = GameState.CRINGE;
        RoundMusicSource.Pause();

        yield return(new WaitForSeconds(1f));

        SFXController.Stop();
        SFXController.PlayCringe();

        if (endCringe)
        {
            for (int frame = 0; frame < cringeBackEnd.Count; frame++)
            {
                GameplayScreen.ChangeBackground(cringeBackEnd[frame]);

                yield return(new WaitForSeconds(0.05f));
            }
        }
        else
        {
            for (int frame = 0; frame < cringeBack.Count; frame++)
            {
                GameplayScreen.ChangeBackground(cringeBack[frame]);

                yield return(new WaitForSeconds(0.05f));
            }
        }

        RoundMusicSource.UnPause();
        currentGameState = GameState.PLAYING;
    }