IEnumerator WaitAnimationFinish() { while (AreaDataItemList.Count < AreaDataList.Count) { yield return(null); } while (m_buttonAnimationFinish == false || m_iconAnimationFinish == false) { yield return(null); } for (int i = 0; i < m_switchButtonRoots.Length; ++i) { AreaSelectSwitchButton button = m_switchButtonRoots[i].GetComponentInChildren <AreaSelectSwitchButton>(); if (button != null) { button.m_bufEventAnimationStart = true; if (m_switchButtons[i].isSelected == false) { button.setBufEvent(false); button.setBufEvent(true, MainMenuManager.Instance.Footer.getFooterBufAnimationTime()); } else { button.setBufEvent(false); } } } for (int i = 0; i < AreaDataItemList.Count; ++i) { AreaDataListItem item = AreaDataItemList[i].GetComponent <AreaDataListItem>(); if (item != null) { item.setBufEvent(true, MainMenuManager.Instance.Footer.getFooterBufAnimationTime()); } } }
private void SetUpSwitchButtons() { var indexActionMap = new List <System.Action> { OnSelectSwitch0, OnSelectSwitch1, OnSelectSwitch2, }; var tabName = new List <string> { GameTextUtil.GetText("map_tab1"), GameTextUtil.GetText("map_tab2"), GameTextUtil.GetText("map_tab3"), }; var areaCategoryLabel = new List <MasterDataDefineLabel.AreaCategory> { MasterDataDefineLabel.AreaCategory.RN_STORY, MasterDataDefineLabel.AreaCategory.RN_SCHOOL, MasterDataDefineLabel.AreaCategory.RN_EVENT, }; m_buttonAnimationFinish = false; int size = m_switchButtonRoots.Length; for (int i = 0; i < size; i++) { int index = i; bool bufEvent = MainMenuUtil.checkHelpBufEvent(areaCategoryLabel[index]); var model = new AreaSelectSwitchButtonModel(index); model.OnClicked += () => { if (model.isSelected) { return; } indexActionMap[index](); }; model.OnShowedNext += () => { if (index == size - 1) { m_buttonAnimationFinish = true; return; } m_switchButtons[index + 1].Appear(); }; model.labelText = tabName[index]; AreaSelectSwitchButton .Attach(m_switchButtonRoots[index]) .SetModel(model, bufEvent); m_switchButtons.Add(model); } { var model = new ButtonModel(); model.OnClicked += () => { OnSelectMapButton(); }; RegionSwitchButton .Attach(RegionButtonRoot) .SetModel(model); } }