Exemple #1
0
        public void OnUnlockButtonClick()
        {
            char[] correctCharacters = keyDoorWord.spell.ToCharArray();

            bool fillCorrect = true;

            for (int i = 0; i < keyDoorCharacterFillList.Count; i++)
            {
                KeyDoorCharacterFill doorCharacterFill = keyDoorCharacterFillList[i];

                if (doorCharacterFill.fillCharacter != correctCharacters[i])
                {
                    fillCorrect = false;
                    break;
                }
            }

            if (fillCorrect)
            {
                lockIcon.sprite = lockOffSprite;

                GameManager.Instance.soundManager.PlayAudioClip(CommonData.lockOffAudioName);

                keyDoorOperationMask.gameObject.SetActive(true);

                IEnumerator waitQuitCoroutine = UnlockAndWaitAndQuit();

                StartCoroutine(waitQuitCoroutine);
            }
            else
            {
                GameManager.Instance.soundManager.PlayAudioClip(CommonData.wrongTintAudioName);
            }
        }
Exemple #2
0
        private void RemoveCharacterFill(char character)
        {
            for (int i = 0; i < keyDoorCharacterFillList.Count; i++)
            {
                KeyDoorCharacterFill doorCharacterFill = keyDoorCharacterFillList[i];

                if (doorCharacterFill.fillCharacter == character && !doorCharacterFill.fix)
                {
                    doorCharacterFill.Reset();
                    break;
                }
            }
        }
Exemple #3
0
        private void AddCharacterFill(char character)
        {
            for (int i = 0; i < keyDoorCharacterFillList.Count; i++)
            {
                KeyDoorCharacterFill doorCharacterFill = keyDoorCharacterFillList[i];

                if (doorCharacterFill.fillCharacter == ' ')
                {
                    doorCharacterFill.SetUpKeyDoorCharacterFill(character, false);
                    break;
                }
            }
        }
Exemple #4
0
        private void SetUpKeyDoorCharacterFill(HLHWord word)
        {
            keyDoorCharacterFillList.Clear();

            char[] characters = word.spell.ToCharArray();

            for (int i = 0; i < word.wordLength; i++)
            {
                KeyDoorCharacterFill keyDoorCharacter = keyDoorCharacterPool.GetInstance <KeyDoorCharacterFill>(keyDoorCharacterModel.gameObject, keyDoorCharacterContainer);

                keyDoorCharacter.Reset();

                keyDoorCharacterFillList.Add(keyDoorCharacter);
            }
        }
Exemple #5
0
        private void SetCharacterAsHint(char character, int index)
        {
            for (int i = 0; i < characterButtons.Length; i++)
            {
                KeyDoorCharacterButton characterButton = characterButtons[i];

                if (characterButton.character == character && characterButton.characterButton.interactable)
                {
                    characterButton.SetToHint();

                    break;
                }
            }


            KeyDoorCharacterFill keyDoorCharacterFill = keyDoorCharacterFillList[index];

            keyDoorCharacterFill.SetUpKeyDoorCharacterFill(character, true);
        }
Exemple #6
0
        public void OnRefreshButtonClick()
        {
            for (int i = 0; i < filledIndex.Count; i++)
            {
                int index = filledIndex[i];

                KeyDoorCharacterButton characterButton = characterButtons[index];

                characterButton.ResetOnRefresh();
            }

            for (int i = 0; i < keyDoorCharacterFillList.Count; i++)
            {
                KeyDoorCharacterFill keyDoorCharacterFill = keyDoorCharacterFillList[i];
                if (!keyDoorCharacterFill.fix)
                {
                    keyDoorCharacterFill.Reset();
                }
            }
        }