| | |
| | | public class CycleHallWin : Window
|
| | | {
|
| | | [SerializeField] ScrollerController tabScroller;
|
| | | [SerializeField] ScrollerController missionScroller;
|
| | | [SerializeField] ScrollerController giftScroller;
|
| | |
|
| | | [SerializeField] ImageEx imgTitle;
|
| | | [SerializeField] ImageEx imgInfo;
|
| | |
| | | [SerializeField] ButtonEx btnGo;
|
| | | [SerializeField] ButtonEx btnClose;
|
| | |
|
| | | [SerializeField] ScrollerController scroller;
|
| | | RechargeGiftActModel rechargeGiftActModel { get { return ModelCenter.Instance.GetModel<RechargeGiftActModel>(); } }
|
| | | CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | tabScroller.OnRefreshCell += OnScrollerRefreshTabCell;
|
| | | scroller.OnRefreshCell += OnScrollerRefreshCell;
|
| | | missionScroller.OnRefreshCell += OnScrollerRefreshMissionCell;
|
| | | giftScroller.OnRefreshCell += OnScrollerRefreshGiftCell;
|
| | | model.onNowTabIdUpdate += OnNowTabIdUpdate;
|
| | | vipModel.rechargeCountEvent += VipModel_rechargeCountEvent;
|
| | | storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | model.nowTabId = int.Parse(CycleHallConfig.GetKeys()[0]);
|
| | | WindowCenter.Instance.Close<CycleHallWin>();
|
| | | }
|
| | | Display();
|
| | | }
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | tabScroller.OnRefreshCell -= OnScrollerRefreshTabCell;
|
| | | scroller.OnRefreshCell -= OnScrollerRefreshCell;
|
| | | missionScroller.OnRefreshCell -= OnScrollerRefreshMissionCell;
|
| | | giftScroller.OnRefreshCell -= OnScrollerRefreshGiftCell;
|
| | | model.onNowTabIdUpdate -= OnNowTabIdUpdate;
|
| | | vipModel.rechargeCountEvent -= VipModel_rechargeCountEvent;
|
| | | storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
|
| | |
| | | if (operation == Operation.default47)
|
| | | {
|
| | | tabScroller.m_Scorller.RefreshActiveCellViews();
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | missionScroller.m_Scorller.RefreshActiveCellViews();
|
| | | giftScroller.m_Scorller.RefreshActiveCellViews();
|
| | | Display();
|
| | | }
|
| | | }
|
| | |
| | | private void OnUpdatePlayerInfoAction()
|
| | | {
|
| | | tabScroller.m_Scorller.RefreshActiveCellViews();
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | missionScroller.m_Scorller.RefreshActiveCellViews();
|
| | | giftScroller.m_Scorller.RefreshActiveCellViews();
|
| | | Display();
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | | {
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | giftScroller.m_Scorller.RefreshActiveCellViews();
|
| | | model.IsPlayAnimation = true;
|
| | | }
|
| | |
|
| | | private void VipModel_rechargeCountEvent(int obj)
|
| | | {
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | giftScroller.m_Scorller.RefreshActiveCellViews();
|
| | | model.IsPlayAnimation = true;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | tabScroller.m_Scorller.RefreshActiveCellViews();
|
| | | CreateScroller();
|
| | | scroller.JumpIndex(JumpIndex());
|
| | | missionScroller.JumpIndex(JumpMissionIndex());
|
| | | giftScroller.JumpIndex(JumpGiftIndex());
|
| | | Display();
|
| | | }
|
| | |
|
| | |
| | | _cell.Display(_cell.index);
|
| | | }
|
| | |
|
| | | private void OnScrollerRefreshCell(ScrollerDataType type, CellView cell)
|
| | | private void OnScrollerRefreshMissionCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as CycleHallCell;
|
| | | var _cell = cell as CycleHallMissionCell;
|
| | | _cell.Display(_cell.index, cell);
|
| | | model.IsPlayAnimation = true;
|
| | | }
|
| | |
|
| | | private void OnScrollerRefreshGiftCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as CycleHallGiftCell;
|
| | | _cell.Display(_cell.index, cell);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | CreateTabScroller();
|
| | | tabScroller.JumpIndex(JumpTabIndex());
|
| | | CreateScroller();
|
| | | scroller.JumpIndex(JumpIndex());
|
| | | missionScroller.JumpIndex(JumpMissionIndex());
|
| | | giftScroller.JumpIndex(JumpGiftIndex());
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | private void CreateScroller()
|
| | | {
|
| | | missionScroller.SetActive(false);
|
| | | giftScroller.SetActive(false);
|
| | | int id = model.nowTabId;
|
| | | if (!CycleHallConfig.Has(id))
|
| | | return;
|
| | |
| | |
|
| | | if (config.TabType == 1)
|
| | | {
|
| | | scroller.Refresh();
|
| | | missionScroller.SetActive(true);
|
| | | missionScroller.Refresh();
|
| | | var act = model.GetOperationInfo();
|
| | | if (act != null && act.TryGetRound(config.RoundType, out var round) && round.AwardList != null)
|
| | | {
|
| | | for (int i = 0; i < round.AwardList.Length; i++)
|
| | | {
|
| | | scroller.AddCell(ScrollerDataType.Header, i, cellInfo);
|
| | | missionScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
|
| | | }
|
| | | }
|
| | | scroller.Restart();
|
| | | missionScroller.Restart();
|
| | | }
|
| | | else if (config.TabType == 2)
|
| | | {
|
| | | scroller.Refresh();
|
| | | giftScroller.SetActive(true);
|
| | | giftScroller.Refresh();
|
| | | var act = model.GetOperationInfo();
|
| | | if (act != null && act.TryGetRound(config.RoundType, out var round) && round.CTGIDList != null)
|
| | | {
|
| | |
| | | int totaleCnt = (_list == null ? 0 : _list.Count) + round.CTGIDList.Length;
|
| | | for (int i = 0; i < totaleCnt; i++)
|
| | | {
|
| | | scroller.AddCell(ScrollerDataType.Header, i, cellInfo);
|
| | | giftScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
|
| | | }
|
| | | }
|
| | | scroller.Restart();
|
| | | giftScroller.Restart();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private int JumpIndex()
|
| | | {
|
| | | int id = model.nowTabId;
|
| | | if (!CycleHallConfig.Has(id))
|
| | | return 0;
|
| | | CycleHallConfig config = CycleHallConfig.Get(id);
|
| | | if (config.TabType == 1)
|
| | | {
|
| | | return JumpMissionIndex();
|
| | | }
|
| | | else if (config.TabType == 2)
|
| | | {
|
| | | return JumpGiftIndex();
|
| | | }
|
| | | return 0;
|
| | | }
|