void Update() { if (!answered) { timeQuestion -= Time.deltaTime; timerBar.fillAmount = timeQuestion / 60.0f; if (timeQuestion >= 30.0f) { timerBar.color = Color.green; } else if (timeQuestion >= 15.0f) { timerBar.color = Color.yellow; } else if (timeQuestion >= 0.0f) { timerBar.color = Color.red; } else { SoundManager.PlayAnswerSound(false); answersNonInteractable(); GameBehaviourScript.SendJugada(QuestionDataScript.getPosition(), "", true, false); StartCoroutine(WaitAndExit(1)); } } }
private void AnswerThreeButtonOnClick() { answersNonInteractable(); answered = true; if (QuestionDataScript.getCorrectAnswer() == 2) { string quesito = QuestionDataScript.getCategory(); Debug.Log("GETQUESITO" + QuestionDataScript.getQuesito()); if (QuestionDataScript.getQuesito()) { activateQuesito(quesito); } answerThreeButton.GetComponent <Image>().color = Color.green; SoundManager.PlayAnswerSound(true); addCoin(); GameBehaviourScript.SendJugada(QuestionDataScript.getPosition(), QuestionDataScript.getQuesito() ? quesito : "", false, false); } else { answerThreeButton.GetComponent <Image>().color = Color.red; SoundManager.PlayAnswerSound(false); GameBehaviourScript.SendJugada(QuestionDataScript.getPosition(), "", true, false); } StartCoroutine(WaitAndExit(2)); }