예제 #1
0
    void ReceiveEvaluatorResult(string content)
    {
        voiceHint = false;
        Result result = XmlParser.Parse(content);

        if (result.error == Error.NORMAL)
        {
            Sentence sentence = Sentence.Get(dialog.answerIds[answerIndex]);

            Server.GetInstance().Studying(sentence, result.score.total);

            iPlay.PlayAnimation(sentence.anim);
            iPlay.Hide();

            totalScore += result.score.total;

            float time = 0.5f;

            if (result.score.total > 4)
            {
                Hint.GetInstance().Show("棒极了!", "Perfect!");
                //time = Audio.GetInstance().Play(AudioType.INTRO, "perfect");
            }
            else if (result.score.total > 3)
            {
                Hint.GetInstance().Show("非常棒!", "Great!");
                //time = Audio.GetInstance().Play(AudioType.INTRO, "great");
            }
            else if (result.score.total > 2)
            {
                Hint.GetInstance().Show("不错!", "Good!");
                //time = Audio.GetInstance().Play(AudioType.INTRO, "good");
            }
            else
            {
                Hint.GetInstance().Show("加油!", "Come on!");
                //time = Audio.GetInstance().Play(AudioType.INTRO, "comeon");
            }

            ShowStar(result.score.total);

            index++;
            StartCoroutine(Evaluating(time, SUCCESS));
        }
        else
        {
            StartCoroutine(Evaluating(0, FAILED));
        }
    }