private IEnumerator SelectDelayed(Selectable selectable) { while (!selectable.gameObject.activeInHierarchy) { yield return(null); } if (selectable is MenuSelectable ms) { ms.DontPlaySelectSound = true; selectable.Select(); ms.DontPlaySelectSound = false; } else { selectable.Select(); } foreach (Animator animator in selectable.GetComponentsInChildren <Animator>()) { if (animator.HasParameter("hide", null)) { animator.ResetTrigger("hide"); } if (animator.HasParameter("show", null)) { animator.SetTrigger("show"); } } yield break; }
private void InitialisePage() { Selectable currentPage = Selectable.GetComponentsInChildren <Selectable>(false).Where((x) => x != Selectable).FirstOrDefault(); _currentSelectable = currentPage.GetCurrentChild(); _currentSelectable.HandleSelect(true); _currentSelectables = currentPage.Children; _currentSelectableIndex = 0; for (; _currentSelectableIndex < _currentSelectables.Length; ++_currentSelectableIndex) { Selectable selectable = _currentSelectables[_currentSelectableIndex]; if (selectable != null && _currentSelectable == selectable) { return; } } _currentSelectableIndex = int.MinValue; }
private void InitialisePage() { MonoBehaviour currentPage = (MonoBehaviour)Selectable.GetComponentsInChildren(_selectableType, false).Where((x) => x != Selectable).FirstOrDefault(); _currentSelectable = (MonoBehaviour)_getCurrentChildMethod.Invoke(currentPage, null); _handleSelectMethod.Invoke(_currentSelectable, new object[] { true }); _currentSelectables = (Array)_childrenField.GetValue(currentPage); _currentSelectableIndex = 0; for (; _currentSelectableIndex < _currentSelectables.Length; ++_currentSelectableIndex) { object selectable = _currentSelectables.GetValue(_currentSelectableIndex); if (selectable != null && _currentSelectable == (MonoBehaviour)selectable) { return; } } _currentSelectableIndex = int.MinValue; }