Esempio n. 1
0
        public PauseControl(CUIFormScript rootForm)
        {
            GameObject gameObject = Utility.FindChild(rootForm.gameObject, "PauseResume");

            gameObject.CustomSetActive(false);
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            this.MaxAllowTimes = ((!curLvelContext.IsGameTypePvpRoom()) ? 0 : ((!Singleton <WatchController> .GetInstance().IsLiveCast) ? curLvelContext.m_pauseTimes : 255));
            if (this.MaxAllowTimes == 0)
            {
                this._root = null;
                return;
            }
            this.CurPauseTimes = ((Singleton <LobbyLogic> .GetInstance().reconnGameInfo == null) ? 0 : Singleton <LobbyLogic> .GetInstance().reconnGameInfo.bPauseNum);
            this._root         = gameObject;
            if (this._root)
            {
                this._pauseNode      = Utility.FindChild(this._root, "PauseNode");
                this._resumeNode     = Utility.FindChild(this._root, "ResumeNode");
                this._passedTimeTxt  = Utility.GetComponetInChild <Text>(this._pauseNode, "PassedTime");
                this._pauseCampTxt   = Utility.GetComponetInChild <Text>(this._pauseNode, "PauseCamp");
                this._resumeButton   = Utility.GetComponetInChild <Button>(this._pauseNode, "ResumeButton");
                this._resumeTimerTxt = Utility.GetComponetInChild <Text>(this._pauseNode, "ResumeButton/Text");
                this._remainNode     = Utility.FindChild(this._pauseNode, "RemainTimes");
                this._remainTimesTxt = Utility.GetComponetInChild <Text>(this._remainNode, "Times");
                this._root.CustomSetActive(false);
            }
            this._pauseTimer = 0;
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_ResumeMultiGame, new CUIEventManager.OnUIEventHandler(this.OnResumeMultiGame));
        }