private IEnumerator SpawnLetters(List <Letter> letterList, LevelInfo data) { foreach (var item in letterList) { item.gameObject.GetComponent <Image>().enabled = true; item.gameObject.GetComponentInChildren <Text>().enabled = true; item.gameObject.GetComponent <Animation>().Play("FadeIn"); yield return(new WaitForSeconds(0.06f)); //Wait a bit to make a dominoes effect for letters } yield return(new WaitForSeconds(0.4f)); //Handle if some hints already been used earlier if (data.lettersOppened != 0) { int i = data.lettersOppened; do { StaticBehaviors.RevealLetter(letterFieldsList, letterList, LevelManager.rightAnswerList); i--; } while (i != 0); } if (data.isLettersRemoved) { StaticBehaviors.RemoveWrongLetters(letterFieldsList, letterList, LevelManager.rightAnswerList); } LevelManager.isPaused = false; }
//Hints handler private void UseHint(int index) { if (StaticBehaviors.EnoughCoinsForHint(index)) { switch (index) { case 0: StaticBehaviors.RevealOneLetter(letterFieldsList, letterList, LevelManager.rightAnswerList); break; case 1: StaticBehaviors.RemoveWrongLetters(letterFieldsList, letterList, LevelManager.rightAnswerList); break; case 2: StaticBehaviors.SolveTask(letterFieldsList, letterList, LevelManager.rightAnswerList); break; } HintEvent(index, null); hintsPopup.gameObject.SetActive(false); } }