private void Update() { if (!enabled || Mathf.Abs(draggablePanel.currentMomentum.y) <= 0.0 && Mathf.Abs(draggablePanel.currentMomentum.x) <= 0.0) { return; } isStartMove = true; if (!isStartMove) { return; } IEnumerator enumerator = gameObject.transform.GetChild(0).GetEnumerator(); try { while (enumerator.MoveNext()) { ScrollItemKeyNavigation component = ((Component)enumerator.Current).gameObject.GetComponent <ScrollItemKeyNavigation>(); component.enabled = false; component.CheckVisibility(); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public virtual void OnItemSelect(GameObject go) { UIScene sceneFromState = PersistenSingleton <UIManager> .Instance.GetSceneFromState(PersistenSingleton <UIManager> .Instance.State); sceneFromState?.OnItemSelect(go); if (PersistenSingleton <UIManager> .Instance.Dialogs != null) { PersistenSingleton <UIManager> .Instance.Dialogs.OnItemSelect(go); } if (!go.GetComponent <ScrollItemKeyNavigation>()) { return; } ScrollItemKeyNavigation component = go.GetComponent <ScrollItemKeyNavigation>(); if (!component || !component.ListPopulator) { return; } component.ListPopulator.itemHasChanged(go); }
private void OnSnapFinish() { isScrollMove = false; ScrollButton.CheckScrollPosition(); IEnumerator enumerator = transform.GetChild(0).GetEnumerator(); try { while (enumerator.MoveNext()) { GameObject gameObject = ((Component)enumerator.Current).gameObject; if (gameObject.activeSelf) { ScrollItemKeyNavigation component = gameObject.GetComponent <ScrollItemKeyNavigation>(); component.enabled = true; component.CheckVisibility(); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } ButtonGroupState.UpdateActiveButton(); }
private void onScrollFinished() { if (this.isEnable) { this.isScrollMove = false; ButtonGroupState.MuteActiveSound = true; this.CheckScrollPosition(); foreach (Object obj in this.ScrollViewPanel.transform.GetChild(0)) { Transform transform = (Transform)obj; GameObject gameObject = transform.gameObject; if (gameObject.activeSelf) { ScrollItemKeyNavigation component = gameObject.GetComponent <ScrollItemKeyNavigation>(); component.enabled = true; component.CheckVisibility(); RecycleListItem component2 = gameObject.GetComponent <RecycleListItem>(); if (component2) { component2.CheckVisibilty(); } } } ButtonGroupState.MuteActiveSound = false; } }
private void ChangeSelectItem() { Int32 childCount = this.ScrollPanel.transform.GetChild(0).childCount; Int32 siblingIndex = base.transform.GetSiblingIndex(); if (siblingIndex > 0) { Int32 i = siblingIndex - 1; GameObject child = this.ScrollPanel.gameObject.GetChild(0).GetChild(i); while (i > 0) { i--; if (child.activeSelf) { child = this.ScrollPanel.gameObject.GetChild(0).GetChild(i); if (child) { ScrollItemKeyNavigation component = child.GetComponent <ScrollItemKeyNavigation>(); if (this.ScrollPanel.IsVisible(component.VisionCheckWidget)) { ButtonGroupState.ActiveButton = child; break; } } } } } if (siblingIndex < childCount - 2) { Int32 j = siblingIndex + 1; GameObject child2 = this.ScrollPanel.gameObject.GetChild(0).GetChild(j); while (j < childCount - 1) { j++; if (child2.activeSelf) { child2 = this.ScrollPanel.gameObject.GetChild(0).GetChild(j); if (child2) { ScrollItemKeyNavigation component2 = child2.GetComponent <ScrollItemKeyNavigation>(); if (this.ScrollPanel.IsVisible(component2.VisionCheckWidget)) { ButtonGroupState.ActiveButton = child2; break; } } } } } }
private void OnSnapFinish() { this.isScrollMove = false; this.ScrollButton.CheckScrollPosition(); foreach (Object obj in base.transform.GetChild(0)) { Transform transform = (Transform)obj; GameObject gameObject = transform.gameObject; if (gameObject.activeSelf) { ScrollItemKeyNavigation component = gameObject.GetComponent <ScrollItemKeyNavigation>(); component.enabled = true; component.CheckVisibility(); } } ButtonGroupState.UpdateActiveButton(); }
private void Update() { if (base.enabled && (Mathf.Abs(this.draggablePanel.currentMomentum.y) > 0f || Mathf.Abs(this.draggablePanel.currentMomentum.x) > 0f)) { this.isStartMove = true; if (this.isStartMove) { foreach (Object obj in base.gameObject.transform.GetChild(0)) { Transform transform = (Transform)obj; GameObject gameObject = transform.gameObject; ScrollItemKeyNavigation component = gameObject.GetComponent <ScrollItemKeyNavigation>(); component.enabled = false; component.CheckVisibility(); } } } }
private void InitListItemWithIndex(Transform item, Int32 dataIndex, Int32 poolIndex) { RecycleListItem component = item.GetComponent <RecycleListItem>(); component.ItemDataIndex = dataIndex; component.ListPopulator = this; component.Panel = this.panel; ScrollItemKeyNavigation component2 = item.GetComponent <ScrollItemKeyNavigation>(); if (component2) { component2.ScrollButton = this.ScrollButton; component2.ScrollPanel = this.panel; } UIKeyNavigation component3; if (ButtonGroupState.ActiveGroup == ItemUI.ItemArrangeGroupButton) { component3 = item.GetChild(1).GetComponent <UIKeyNavigation>(); } else { component3 = item.GetComponent <UIKeyNavigation>(); } if (component3) { component3.startsSelected = (this.activeNumber == dataIndex); } ButtonGroupState component4 = item.GetComponent <ButtonGroupState>(); if (component4) { ButtonGroupState.RemoveActiveStateOnGroup(item.gameObject, component4.GroupName); } item.name = "Item " + dataIndex; this.PopulateListItemWithData(item, this.dataList[dataIndex], dataIndex, true); this.dataTracker.Add(this.itemsPool[poolIndex].GetComponent <RecycleListItem>().ItemDataIndex, this.itemsPool[poolIndex].GetComponent <RecycleListItem>().ItemNumber); }