private void FocusIndexChanged(int focusIndex) { SelectedWord = WordSuggestions[focusIndex]; Controller.SetIndicatorRect(SelectedWord.GetComponent <RectTransform>()); if (FocusCycler.FocusChangeCount > WordSuggestions.Length + 1) { Controller.InputStrategyFinished(); } }
private void UpdateDisplayText() { InputText.text = SentenceBuilder.ToString(); InputText.color = SentenceBuilder.ShouldClearOnNextInput ? Color.gray : Color.white; foreach (GameObject gameObject in WordSelectionPanel.GetChildGameObjects()) { Object.Destroy(gameObject); } foreach (string suggestedWord in SentenceBuilder.SuggestedWords) { GameObject presenterGameObject = Instantiate(WordSuggestionPrefab); WordSuggestionPresenter presenter = presenterGameObject.GetComponent <WordSuggestionPresenter>(); presenter.Word = suggestedWord; presenter.transform.SetParent(WordSelectionPanel.transform); } }
private IEnumerator RestartFocusCycler() { SelectedWord = null; yield return(new WaitForEndOfFrame()); WordSuggestions = Controller.GetWordSelectionPanel().GetComponentsInChildren <WordSuggestionPresenter>() .Where(x => x) .ToArray(); if (WordSuggestions.Length == 0) { Controller.InputStrategyFinished(); } else { FocusCycler.Start(WordSuggestions.Length); } }