feature: Added menu functionality

This commit is contained in:
Gerard Gascón 2024-01-28 12:36:32 +01:00
parent 3b730311fc
commit 38c0bcaef4
9 changed files with 134 additions and 247 deletions

View file

@ -73,12 +73,15 @@ namespace Messaging {
if (message == _currentJoke.AnswerMessage.Key) {
_sendButton.Lock();
bool isCorrect = _currentJokeIndex != 0;
Coroutine routine = StartCoroutine(ShowRealTexts(isCorrect));
StartCoroutine(SendRandomJoke(routine, sendJokeDelay));
if (isCorrect) {
FindObjectOfType<ProgressBar>().AddProgress();
if (FindObjectOfType<ProgressBar>().AddProgress())
return;
}
Coroutine routine = StartCoroutine(ShowRealTexts(isCorrect));
StartCoroutine(SendRandomJoke(routine, sendJokeDelay));
_lives.ResetLives();
} else {
_lives.Wrong();
if (_lives.CurrentLives == 0) {