コード例 #1
0
    public void ClickHint(bool isFree)
    {
        PictureLetter pic = select.Find(x => x.isShowing == false);

        if (pic != null)
        {
            List <int> notShowIndex = new List <int> ();
            if (!isFree)
            {
                CurrencyController.DebitBalance(Const.HINT_COST);
            }
            for (int i = 0; i < select.Count; i++)
            {
                if (select[i].isShowing == false)
                {
                    notShowIndex.Add(i);
                }
            }
            //随机出现hint的提示
            int index = Random.Range(0, notShowIndex.Count);
            select[notShowIndex[index]].Show(true);
            PictureLetter picletter = letterGroup.Find(x => x.letter.text == select[notShowIndex[index]].rightLetter);
            if (picletter != null)
            {
                answerDic[notShowIndex[index]] = picletter;
                picletter.Hide();
            }
            CheckGameComplete();
        }
    }
コード例 #2
0
    public void SetAnswerCellText(string text, PictureLetter letter)
    {
        for (int i = 0; i < select.Count; i++)
        {
            if (select[i].isShowing == false)
            {
                select[i].Back(text);
                answerDic[i] = letter;
                letter.Hide();
                break;
            }
        }

        CheckGameComplete();
    }