private IEnumerator ChangePageCoroutine(int pageIndex) { IAlbumModel[] nextPageAlbumModels = mAlbumModels.Skip(pageIndex * 10).Take(10).ToArray(); mCurrentPageIndex = pageIndex; mLabel_PageCurrent.text = (mCurrentPageIndex + 1).ToString(); mLabel_PageTotal.text = (mAlbumModels.Length / 10 + ((mAlbumModels.Length % 10 != 0) ? 1 : 0)).ToString(); for (int listItemIndex2 = 0; listItemIndex2 < mUIShipAlbumListItems.Length; listItemIndex2++) { UIShipAlbumListItem targetListItem = mUIShipAlbumListItems[listItemIndex2]; if (listItemIndex2 < nextPageAlbumModels.Length) { targetListItem.Hide(); } } for (int listItemIndex = 0; listItemIndex < mUIShipAlbumListItems.Length; listItemIndex++) { UIShipAlbumListItem targetListItem2 = mUIShipAlbumListItems[listItemIndex]; if (listItemIndex < nextPageAlbumModels.Length) { IAlbumModel albumModel = nextPageAlbumModels[listItemIndex]; IEnumerator childInitializeCoroutine = targetListItem2.GenerateInitializeCoroutine(albumModel); yield return(StartCoroutine(childInitializeCoroutine)); targetListItem2.Show(); } } }
private void Awake() { UIShipAlbumListItem[] array = this.mUIShipAlbumListItems; for (int i = 0; i < array.Length; i++) { UIShipAlbumListItem uIShipAlbumListItem = array[i]; uIShipAlbumListItem.SetOnSelectedListener(new Action <UIShipAlbumListItem>(this.OnSelectedListItemListener)); } this.mUIDisplaySwipeEventRegion.SetOnSwipeActionJudgeCallBack(new UIDisplaySwipeEventRegion.SwipeJudgeDelegate(this.SwipeJudgeDelegate)); }
private void OnSelectedListItemListener(UIShipAlbumListItem calledObject) { IAlbumModel albumModel = calledObject.GetAlbumModel(); bool flag = albumModel != null; if (mOnSelectedListItemListener != null && flag) { ChangeFocus(calledObject, needSe: false); mOnSelectedListItemListener(albumModel); } }
private void OnDestroy() { mTexture_Focus = null; mUIShipAlbumListItems = null; mLabel_PageCurrent = null; mLabel_PageTotal = null; mUIDisplaySwipeEventRegion = null; mCurrentFocusListItem = null; mKeyController = null; mAlbumModels = null; mOnSelectedListItemListener = null; mOnBackListener = null; }
private void ChangeFocus(UIShipAlbumListItem target, bool needSe) { if (mCurrentFocusListItem != null && !mCurrentFocusListItem.Equals(target) && needSe) { SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove); } mCurrentFocusListItem = target; if (mCurrentFocusListItem != null) { mTexture_Focus.transform.localPosition = mCurrentFocusListItem.transform.localPosition; UISelectedObject.SelectedOneObjectBlink(mTexture_Focus.gameObject, value: true); } else { UISelectedObject.SelectedOneObjectBlink(mTexture_Focus.gameObject, value: false); } }
private void ChangeFocus(UIShipAlbumListItem target, bool needSe) { if (this.mCurrentFocusListItem != null && !this.mCurrentFocusListItem.Equals(target) && needSe) { SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove); } this.mCurrentFocusListItem = target; if (this.mCurrentFocusListItem != null) { this.mTexture_Focus.get_transform().set_localPosition(this.mCurrentFocusListItem.get_transform().get_localPosition()); UISelectedObject.SelectedOneObjectBlink(this.mTexture_Focus.get_gameObject(), true); } else { UISelectedObject.SelectedOneObjectBlink(this.mTexture_Focus.get_gameObject(), false); } }
private void Update() { if (mKeyController == null) { return; } if (mKeyController.IsRDown()) { SingletonMonoBehaviour <PortObjectManager> .Instance.BackToStrategy(); } else if (mKeyController.IsRSLeftDown()) { PrevPage(); } else if (mKeyController.IsRSRightDown()) { NextPage(); } else if (mKeyController.keyState[0].down) { OnBack(); } else if (mKeyController.keyState[1].down) { OnSelectedListItemListener(mCurrentFocusListItem); } else if (mKeyController.keyState[14].down) { int num = Array.IndexOf(mUIShipAlbumListItems, mCurrentFocusListItem); int num2 = num - 1; if (0 <= num2) { UIShipAlbumListItem target = mUIShipAlbumListItems[num2]; ChangeFocus(target, needSe: true); } } else if (mKeyController.keyState[10].down) { int num3 = Array.IndexOf(mUIShipAlbumListItems, mCurrentFocusListItem); int num4 = num3 + 1; if (num4 < mUIShipAlbumListItems.Length) { UIShipAlbumListItem target2 = mUIShipAlbumListItems[num4]; ChangeFocus(target2, needSe: true); } } else if (mKeyController.keyState[8].down) { int num5 = Array.IndexOf(mUIShipAlbumListItems, mCurrentFocusListItem); int num6 = num5 - 5; if (0 <= num6) { UIShipAlbumListItem target3 = mUIShipAlbumListItems[num6]; ChangeFocus(target3, needSe: true); } } else if (mKeyController.keyState[12].down) { int num7 = Array.IndexOf(mUIShipAlbumListItems, mCurrentFocusListItem); int num8 = num7 + 5; if (num8 < mUIShipAlbumListItems.Length) { UIShipAlbumListItem target4 = mUIShipAlbumListItems[num8]; ChangeFocus(target4, needSe: true); } } }
private void Update() { if (this.mKeyController != null) { if (this.mKeyController.IsRDown()) { SingletonMonoBehaviour <PortObjectManager> .Instance.BackToStrategy(); } else if (this.mKeyController.IsRSLeftDown()) { this.PrevPage(); } else if (this.mKeyController.IsRSRightDown()) { this.NextPage(); } else if (this.mKeyController.keyState.get_Item(0).down) { this.OnBack(); } else if (this.mKeyController.keyState.get_Item(1).down) { this.OnSelectedListItemListener(this.mCurrentFocusListItem); } else if (this.mKeyController.keyState.get_Item(14).down) { int num = Array.IndexOf <UIShipAlbumListItem>(this.mUIShipAlbumListItems, this.mCurrentFocusListItem); int num2 = num - 1; if (0 <= num2) { UIShipAlbumListItem target = this.mUIShipAlbumListItems[num2]; this.ChangeFocus(target, true); } } else if (this.mKeyController.keyState.get_Item(10).down) { int num3 = Array.IndexOf <UIShipAlbumListItem>(this.mUIShipAlbumListItems, this.mCurrentFocusListItem); int num4 = num3 + 1; if (num4 < this.mUIShipAlbumListItems.Length) { UIShipAlbumListItem target2 = this.mUIShipAlbumListItems[num4]; this.ChangeFocus(target2, true); } } else if (this.mKeyController.keyState.get_Item(8).down) { int num5 = Array.IndexOf <UIShipAlbumListItem>(this.mUIShipAlbumListItems, this.mCurrentFocusListItem); int num6 = num5 - 5; if (0 <= num6) { UIShipAlbumListItem target3 = this.mUIShipAlbumListItems[num6]; this.ChangeFocus(target3, true); } } else if (this.mKeyController.keyState.get_Item(12).down) { int num7 = Array.IndexOf <UIShipAlbumListItem>(this.mUIShipAlbumListItems, this.mCurrentFocusListItem); int num8 = num7 + 5; if (num8 < this.mUIShipAlbumListItems.Length) { UIShipAlbumListItem target4 = this.mUIShipAlbumListItems[num8]; this.ChangeFocus(target4, true); } } } }