private void CheckBox(ItemLevel prevBox, ItemLevel currentBox) { var word = dataLevelManager .WordsWithoutLetters[currentBox.Line] .Remove(currentBox.PosInWord, 1); dataLevelManager.WordsWithoutLetters[currentBox.Line] = word.Insert(currentBox.PosInWord, currentBox.CurrentLetter.ToString()); if (dataLevelManager.WordsWithoutLetters[currentBox.Line] == dataLevelManager.WordsList[currentBox.Line]) { SetCheckWordImage(currentBox.Line, true); currentBox.CallInteractable(currentBox.Line); AttemptCounter.SetAttempt(true); countTrueWords++; if (countTrueWords >= dataLevelManager.WordsList.Count) { CheckWinLevel(); } } if (prevBox != null && prevBox.transform.parent != currentBox.transform.parent && dataLevelManager.WordsWithoutLetters[prevBox.Line] != dataLevelManager.WordsList[prevBox.Line]) { AnimField(prevBox.Line); SetCheckWordImage(prevBox.Line, false); AttemptCounter.SetAttempt(false); } }
private void ClickBox() { SetItem(); onClickBox?.Invoke(prevItem, this); prevItem = this; }