Esempio n. 1
0
    private IEnumerator StartRound(float endOfRound, float difRound)
    {
        yield return(new WaitForSeconds(endOfRound));

        GameplayScreen.SetScreenVisibility(false);
        GameplayScreen.ResetData();

        Board.ResetBoard();

        RoundSprite.gameObject.SetActive(true);
        RoundSprite.sprite  = RoundSprites[_currentRound];
        RoundNarration.clip = RoundNarrations[_currentRound];
        RoundNarration.PlayDelayed(0.5f);

        yield return(new WaitForSeconds(difRound));

        RoundNarration.Stop();
        RoundSprite.gameObject.SetActive(false);
        currentGameState = GameState.PLAYING;

        noraImages.ChangeImage(_currentRound);

        GameplayScreen.SetScreenVisibility(true);

        _telephoneCentral.InitializeRound(_phoneCallsHarcoded.phoneCalls[_currentRound], phoneRates[_currentRound], _currentRound == _phoneCallsHarcoded.phoneCalls.Count - 1);
        StressController.SetupStresslevels(startStressLevel[_currentRound], maxStressLevel[_currentRound]);
        RoundMusicSource.clip = RoundMusic[_currentRound];
        RoundMusicSource.Play();

        while (RoundMusicSource.volume < 0.2f)
        {
            yield return(new WaitForSeconds(0.05f));

            RoundMusicSource.volume += 0.025f;
        }
    }