public void Initialize(int wordLength) { this.wordLength = wordLength; lettersOfWordInHistory = wordHistoryGrid.gameObject.GetComponent<LetterGridController> (); wordHistoryGrid.GetComponent<UIGrid> ().maxPerLine = wordLength; letterImageTable = GameObject.Find ("DataTables").GetComponent<LetterImageTable> (); InteractiveLetter.LetterPressed += PlayWordOfPressedLetter; }
void UpdateInterfaceLetters(LetterSoundComponent lc, LetterGridController letterGridController, int indexOfLetterBarCell, bool flash) { InteractiveLetter i; if (SessionsDirector.instance.IsSyllableDivisionMode) { i = letterGridController.GetInteractiveLetter (indexOfLetterBarCell); i.UpdateDefaultColour (SessionsDirector.colourCodingScheme.GetColorsForWholeWord ()); i.SetSelectColour (lc.GetColour ()); } else { i = letterGridController.UpdateLetter (indexOfLetterBarCell, lc.GetColour ()); } char letter = lc.AsString[0]; bool flashInteractiveLetter = SessionsDirector.instance.IsMagicERule && IsVowel(lc.AsString[0]); flashInteractiveLetter&= flash && i.HasLetterOrSoundChanged (lc) && lc.GetColour () == i.CurrentColor (); i.LetterSoundComponentIsPartOf = lc; if (flashInteractiveLetter) { i.StartCoroutine ("Flash"); } }
UserWord GetNewColoursAndSoundsFromDecoder(LetterGridController letterGridController) { return LetterSoundComponentFactoryManager.Decode (GetUserControlledLettersAsString (false), SessionsDirector.instance.IsSyllableDivisionMode); }
void AssignNewColoursAndSoundsToLetters(UserWord letterSoundComponents, LetterGridController letterGridController, bool flash) { int indexOfLetterBarCell = startingIndexOfUserLetters; foreach (LetterSoundComponent p in letterSoundComponents) { //ending index == total number of letters minus one. if (indexOfLetterBarCell <= endingIndexOfUserLetters) { //no longer required because I fixed the bug in the LCFactoryManager that caused the error, but I'm leaving this here for redundant error protection... if (p is LetterSoundComposite) { LetterSoundComposite l = (LetterSoundComposite)p; foreach (LetterSoundComponent lc in l.Children) { UpdateInterfaceLetters (lc, letterGridController, indexOfLetterBarCell, flash); indexOfLetterBarCell++; } } else { UpdateInterfaceLetters (p, letterGridController, indexOfLetterBarCell, flash); indexOfLetterBarCell++; } } } }
public void Initialize(int startingIndexOfArduinoLetters, int endingIndexOfArduinoLetters, ArduinoUnityInterface tangibleLetters) { StartingIndex = startingIndexOfArduinoLetters; EndingIndex = endingIndexOfArduinoLetters; maxUserLetters = EndingIndex + 1 - StartingIndex; for (int i= 0; i<maxUserLetters; i++) currUserControlledLettersAsStringBuilder.Append (" "); EMPTY_USER_WORD = currUserControlledLettersAsStringBuilder.ToString (); selectedUserControlledLettersAsStringBuilder = new StringBuilder (EMPTY_USER_WORD); letterGrid = letterGridControllerGO.GetComponent<LetterGridController> (); letterGrid.InitializeBlankLetterSpaces (maxUserLetters); AssignInteractiveLettersToTangibleCounterParts (); InteractiveLetter.LetterSelectedDeSelected += LetterSelectDeselect; }