public void OnPlayerSubmittedAnswer(string answer) { if (!isKilled && !isSaved) { if (riddle.TryAnswer(answer)) { // Riddle correct! Let's do something! isSaved = true; if (currentDialogBubble != null) { currentDialogBubble.ForceFadeMessage(); } answerThatSavedMe = answer; responses.AddCorrectAnswerToResponses(answerThatSavedMe); CreateDialogBubble(responses.GetRandomCorrectAnswerResponse(), 0.1f, 0.35f, 1, false, false); SavedEvent.Invoke(this); } else { health -= 1; if (health <= 0) { isKilled = true; answerThatKilledMe = answer; responses.AddWrongAnswerToResponses(answerThatKilledMe); if (currentDialogBubble != null) { currentDialogBubble.ForceFadeMessage(); } DiedEvent.Invoke(this); } } } }