コード例 #1
0
    public void AnswerQuestion(AnswerButton button, int indexQuestion)
    {
        button.MarkAsSuccess(indexQuestion == correctAnswerIndex);

        if (indexQuestion == correctAnswerIndex)
        {
            answerSource.clip = resultSuccess.audio;
            resultText.text   = resultSuccess.text;
        }
        else
        {
            answerSource.clip = resultFailure.audio;
            resultText.text   = resultFailure.text;
        }
        resultCanvas.SetActive(true);
        againButtonText.text = again.text;
        answerSource.Play();
    }