コード例 #1
0
        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);
            }
        }
コード例 #2
0
        void IInputStrategy.Initialize(ITypingController controller)
        {
            Controller       = controller;
            KeyboardSelector = controller.GetKeyboardSelector();
            ClientArea       = Controller
                               .GetKeyboardSelectorClientArea()
                               .GetComponent <RectTransform>();
            this.EnsureAssigned(x => x.ClientArea);
            Rows = Controller
                   .GetKeyboardSelectorClientArea()
                   .GetComponentsInChildren <HorizontalLayoutGroup>()
                   .Select(x => x.GetComponent <RectTransform>())
                   .ToArray();
            RowPositions = RowPositions ?? Rows.Select(x => x.localPosition.y).ToArray();

            FocusIndexChanged(Rows.Length / 2); // Start at index 1, so we can see index 0 scroll into view
            LerpClientAreaPosition(1);

            FocusCycler.Start(Rows.Length);
            Controller.SetIndicatorRect(Controller.GetKeyboardSelectionPanel());
        }
コード例 #3
0
 void IInputStrategy.Initialize(ITypingController controller)
 {
     Controller      = controller;
     SentenceBuilder = controller.GetSentenceBuilder();
     FocusCycler.Start(3);
 }
コード例 #4
0
 void IKeyboardColumnSelectorInputStrategy.SetActiveRow(RectTransform keyboardRow)
 {
     KeyRectTransforms = keyboardRow.GetChildRectTransforms();
     FocusCycler.Start(KeyRectTransforms.Length);
 }