public override void Close()
        {
            if (this._actvMenuList != null)
            {
                for (int i = 0; i < this._actvMenuList.Count; i++)
                {
                    this._actvMenuList[i].Clear();
                }
                this._actvMenuList = null;
            }
            if (this._view != null)
            {
                this._view.Clear();
                this._view = null;
            }
            if (null != this._uiForm)
            {
                Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Activity_Select, new CUIEventManager.OnUIEventHandler(this.OnSelectActivity));

                Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Activity_Select_TitleMenu, new CUIEventManager.OnUIEventHandler(this.OnSelectTitleMenu));

                CUIFormScript uiForm = this._uiForm;
                this._uiForm         = null;
                this._uiListMenu     = null;
                this.m_TitleMenuList = null;
                this.m_TitleListObj  = null;
                this.ClearActiveData();
                Singleton <CUIManager> .GetInstance().CloseForm(uiForm);

                MonoSingleton <NobeSys> .GetInstance().ShowDelayNobeLoseTipsInfo();

                MonoSingleton <PandroaSys> .GetInstance().ShowPopNews();

                MonoSingleton <PandroaSys> .GetInstance().ClosePandoraTabWindow(PandroaSys.PandoraModuleType.action);
            }
            MonoSingleton <IDIPSys> .GetInstance().OnCloseIDIPForm(null);

            Singleton <ActivitySys> .GetInstance().OnStateChange -= new ActivitySys.StateChangeDelegate(this.OnValidateActivityRedSpot);

            Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this._initTimer);
        }
Пример #2
0
        private void onInitTimer(int seq)
        {
            switch (++this._initStep)
            {
            case 1:
                this.InitSelectActivtyMenuData();
                this._title      = Utility.FindChild(this._uiForm.gameObject, "Panel/Title");
                this._titleText  = Utility.GetComponetInChild <Text>(this._title, "Text");
                this._titleImage = Utility.GetComponetInChild <Image>(this._title, "Image");
                this._uiListMenu = Utility.GetComponetInChild <CUIListScript>(this._uiForm.gameObject, "Panel/Panle_Activity/Menu/List");
                this._viewScroll = Utility.GetComponetInChild <ScrollRect>(this._uiForm.gameObject, "Panel/Panle_Activity/ScrollRect");
                this._view       = new CampaignFormView(Utility.FindChild(this._uiForm.gameObject, "Panel/Panle_Activity/ScrollRect/Content"), this, null);
                break;

            case 2:
                this.m_TitleMenuList = Utility.GetComponetInChild <CUIListScript>(this._uiForm.gameObject, "Panel/TitleMenu/List");
                this.m_strTitleList  = new string[this.m_nUseActivityTabCount + 1];
                for (int i = 0; i < this.m_nUseActivityTabCount; i++)
                {
                    if (i < 3)
                    {
                        this.m_strTitleList[i] = Singleton <ActivitySys> .GetInstance().m_ActivtyTabName[i];
                    }
                    else
                    {
                        this.m_strTitleList[i] = Singleton <ActivitySys> .GetInstance().m_ActivtyTabName[0];
                    }
                }
                this.m_strTitleList[this.m_nUseActivityTabCount] = "游戏公告";
                this.m_TitleMenuList.SetElementAmount(this.m_strTitleList.Length);
                this.m_TitleListObj = new GameObject[this.m_strTitleList.Length];
                for (int j = 0; j < this.m_strTitleList.Length; j++)
                {
                    CUIListElementScript elemenet = this.m_TitleMenuList.GetElemenet(j);
                    Text componetInChild          = Utility.GetComponetInChild <Text>(elemenet.gameObject, "Text");
                    if (componetInChild)
                    {
                        componetInChild.text = this.m_strTitleList[j];
                    }
                    this.m_TitleListObj[j] = elemenet.gameObject;
                }
                this.m_TitleMenuList.SelectElement(0, true);
                break;

            case 3:
                this.UpdateBuildMenulistTabIdx(0);
                break;

            case 4:
            {
                int  num  = -1;
                bool flag = true;
                while (++num < this._actvMenuList.get_Count())
                {
                    if ((flag && this._actvMenuList.get_Item(num).activity.ReadyForGet) || (!flag && this._actvMenuList.get_Item(num).activity.ReadyForDot))
                    {
                        break;
                    }
                    if (flag && num + 1 == this._actvMenuList.get_Count())
                    {
                        num  = -1;
                        flag = false;
                    }
                }
                if (num >= this._actvMenuList.get_Count())
                {
                    num = 0;
                }
                this._uiListMenu.SelectElement(num, true);
                this.SelectMenuItem(num);
                Singleton <ActivitySys> .GetInstance().OnStateChange += new ActivitySys.StateChangeDelegate(this.OnValidateActivityRedSpot);

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Activity_Select, new CUIEventManager.OnUIEventHandler(this.OnSelectActivity));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Activity_Select_TitleMenu, new CUIEventManager.OnUIEventHandler(this.OnSelectTitleMenu));

                this.UpdateTitelRedDot();
                Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this._initTimer);

                this._initStep = 0;
                Singleton <ActivitySys> .GetInstance().OnCampaignFormOpened();

                break;
            }
            }
        }