コード例 #1
0
    //------------------------------------------------------------------------------------------
    // CheckAnswer
    //------------------------------------------------------------------------------------------
    public void CheckAnswer()
    {
        if (string.IsNullOrEmpty(m_inputField.text))
        {
            m_inputField.ActivateInputField();
            return;
        }

        // 判定
        if (m_inputField.text == m_answerText.text)
        {
            m_correctAnswer.gameObject.SetActive(true);
            m_audioSource.PlayOneShot(m_correctSE);
            m_correctFlag = true;
            m_countDown.AddScore();
        }
        else
        {
            m_incorrectAnswer.gameObject.SetActive(true);
            m_audioSource.PlayOneShot(m_incorrectSE);
            m_incorrectFlag = true;
        }
    }