예제 #1
0
    public void CheckAnswer(string checkWord)
    {
        LineWord line = lines.Find(x => x.answer == checkWord);

        if (line != null)
        {
            if (!line.isShown)
            {
                textPreview.SetAnswerColor();
                line.ShowAnswer();
                CheckGameComplete();

                if (lines.Last() == line)
                {
                    compliment.ShowRandom();
                }

                Sound.instance.Play(Sound.Others.Match);
            }
            else
            {
                textPreview.SetExistColor();
            }
        }
        else if (validWords.Contains(checkWord.ToLower()))
        {
            ExtraWord.instance.ProcessWorld(checkWord);
        }
        else
        {
            textPreview.SetWrongColor();
        }

        textPreview.FadeOut();
    }
예제 #2
0
    public void CheckAnswer(string checkWord)
    {
        LineWord line = lines.Find(x => x.answer == checkWord);

        if (line != null)
        {
            if (!line.isShown)
            {
                SetCombo(1);
                textPreview.SetAnswerColor();
                line.ShowAnswer();
                CheckGameComplete();
                Compliment.Instance.ShowRandom(MainController.instance.comboCount);
                //if (lines.Last () == line) {
                //    compliment.ShowRandom ();
                //}
                if (checkWord.ToLower() == "word")
                {
                    PlayerDataManager.Instance.playerData.wordCount++;
                    PlayerDataManager.Instance.JudeReachAchieve(15, PlayerDataManager.Instance.playerData.wordCount);
                }
                if (checkWord.ToLower() == "connect")
                {
                    PlayerDataManager.Instance.playerData.connectCount++;
                    PlayerDataManager.Instance.JudeReachAchieve(16, PlayerDataManager.Instance.playerData.connectCount);
                }
                PlayerDataManager.Instance.playerData.accumulativeLinkWord++;
                PlayerDataManager.Instance.JudeReachAchieve(5, PlayerDataManager.Instance.playerData.accumulativeLinkWord);
                Sound.instance.Play(Sound.Others.Match);
            }
            else
            {
                textPreview.SetExistColor();
            }
        }
        else if (validWords.Contains(checkWord.ToLower()))
        {
            ExtraWord.instance.ProcessWorld(checkWord);
        }
        else
        {
            if (textPreview.text.text.Length != 1)
            {
                SetCombo(0);
            }
            textPreview.SetWrongColor();
        }

        textPreview.FadeOut();
    }