Пример #1
0
        public void SetUpWordHUDAndShow(HLHWord word)
        {
            this.questionWord = word;

            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                pronounceNotAvalableHintTextInFill.enabled = true;
            }
            else
            {
                pronounceNotAvalableHintTextInFill.enabled = false;
            }

            pronounceNotAvalableHintTextInExplain.enabled = false;

            gameObject.SetActive(true);

            EnableClick();

            canQuitWhenClickBackground = true;

            explainationSelectPlane.gameObject.SetActive(false);
            characterFillPlane.gameObject.SetActive(true);

            realCharacters   = word.spell.ToCharArray();
            answerCharacters = GenerateCharacterFillArray(word.spell);

            questionForCharacterFill.text       = word.explaination;
            phoneticSymbolForCharacterFill.text = word.phoneticSymbol;

            lockStatusIcon.sprite = lockSprite;

            fillAndCodeCells.Clear();

            for (int i = 0; i < realCharacters.Length; i++)
            {
                char charInQuestion = answerCharacters [i];

                char realChar = realCharacters [i];

                FillAndCodeCell cell = characterToFillCellPool.GetInstance <FillAndCodeCell> (fillAndCodeModel.gameObject, characterToFillCellContainer);

                cell.gameObject.SetActive(true);

                answerCharacters [i] = cell.SetUpFillAndCodeCell(i, charInQuestion, realChar, CharacterChange, CharacterClick);

                fillAndCodeCells.Add(cell);
            }

            //if(GameManager.Instance.gameDataCenter.gameSettings.isAutoPronounce){
            //	OnPronunceButtonClick();
            //}
        }
Пример #2
0
        private void CharacterClick(int characterCellIndex)
        {
            for (int i = 0; i < characterToFillCellContainer.childCount; i++)
            {
                if (i == characterCellIndex)
                {
                    continue;
                }

                FillAndCodeCell cell = characterToFillCellContainer.GetChild(i).GetComponent <FillAndCodeCell>();

                if (!cell.isFoldout)
                {
                    cell.HideCodeButtons();
                    cell.isFoldout = true;
                }
            }
        }