Example #1
0
 private void SetRemainTimeCD(int remainTime)
 {
     this.RemoveRemainTimeCD();
     if (remainTime > 0)
     {
         this.remainTimeCD = new TimeCountDown(remainTime, TimeFormat.HHMMSS, delegate
         {
             string time = TimeConverter.GetTime(remainTime, TimeFormat.HHMMSS);
             if (this.remainTimeCD != null)
             {
                 time = this.remainTimeCD.GetTime();
             }
             string text = GameDataUtils.GetChineseContent(510116, false);
             text        = text.Replace("{s1}", time);
             this.activityRemainTimeText.set_text(text);
         }, delegate
         {
             this.RemoveRemainTimeCD();
             this.activityRemainTimeText.set_text(string.Empty);
         }, true);
     }
     else
     {
         this.activityRemainTimeText.set_text(string.Empty);
     }
 }
Example #2
0
    private void AddTitleRemainTimeCD(int remainTimeUTC)
    {
        this.RemoveTitleRemainTimeCD();
        int num = 0;

        if (remainTimeUTC > 0)
        {
            num = remainTimeUTC - TimeManager.Instance.PreciseServerSecond;
        }
        this.titleRemainTime.set_text(string.Empty);
        if (num <= 0)
        {
            this.titleRemainTime.set_text(GameDataUtils.GetChineseContent(1005016, false));
        }
        if (num > 0)
        {
            this.titleRemianTimeCd = new TimeCountDown(num, TimeFormat.DHHMM_Chinese, delegate
            {
                if (this.titleRemianTimeCd != null && this.titleRemainTime != null)
                {
                    this.titleRemainTime.set_text(this.titleRemianTimeCd.GetTime());
                }
            }, delegate
            {
                this.RemoveTitleRemainTimeCD();
                this.titleRemainTime.set_text(TimeConverter.GetTime(0, TimeFormat.DHHMM_Chinese));
            }, true);
        }
    }
Example #3
0
 private void HandleToShowFirstChat()
 {
     if (this.IsInCD)
     {
         return;
     }
     if (this.timeCountDown != null)
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
     if (this.teamChatList == null || this.teamChatList.get_Count() <= 0)
     {
         return;
     }
     EventDispatcher.Broadcast <ChatManager.ChatInfo>(EventNames.UpdateTeamChatTip, this.teamChatList.get_Item(0));
     this.timeCountDown = new TimeCountDown(this.ShowTeamChatTipTime, TimeFormat.SECOND, delegate
     {
         this.IsInCD = true;
     }, delegate
     {
         this.IsInCD = false;
         this.RemoveFirstChat();
     }, true);
 }
Example #4
0
 private void RefreshCoolDown(long guildID, int CoolDown)
 {
     if (guildID == this.guildBriefInfo.guildId && CoolDown > 0)
     {
         if (this.timeCountDown != null)
         {
             this.timeCountDown.Dispose();
             this.timeCountDown = null;
         }
         ImageColorMgr.SetImageColor(this.btnJoin.GetComponent <Image>(), true);
         this.btnJoin.GetComponent <ButtonCustom>().set_enabled(false);
         base.FindTransform("BtnQueryName").GetComponent <Text>().set_text(CoolDown.ToString());
         this.timeCountDown = new TimeCountDown(CoolDown, TimeFormat.SECOND, delegate
         {
             if (this.timeCountDown != null && base.get_transform() != null)
             {
                 base.FindTransform("BtnQueryName").GetComponent <Text>().set_text(this.timeCountDown.GetSeconds().ToString());
             }
         }, delegate
         {
             if (this.timeCountDown != null && base.get_transform() != null)
             {
                 ImageColorMgr.SetImageColor(this.btnJoin.GetComponent <Image>(), false);
                 this.btnJoin.GetComponent <ButtonCustom>().set_enabled(true);
                 base.FindTransform("BtnQueryName").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(515032, false));
             }
         }, true);
     }
 }
Example #5
0
 private void startTimeCoundDown(int time)
 {
     this.ClearTimeCoundDown();
     if (time <= 0)
     {
         return;
     }
     this.timeCoundDown = new TimeCountDown(time, TimeFormat.SECOND, delegate
     {
         if (ActivityTossDiscountUI.Instance != null)
         {
             ActivityTossDiscountUI.Instance.updateTimeCoundDown(TimeConverter.GetTime(this.timeCoundDown.GetSeconds(), TimeFormat.HHMMSS) + " 后刷新商品折扣");
         }
     }, delegate
     {
         if (ActivityTossDiscountUI.Instance != null)
         {
             this.initDiscountData();
             ActivityTossDiscountManager.Instance.cleanCurrentShangPinId();
             ActivityTossDiscountManager.Instance.cleanDiscountData();
             if (ActivityTossDiscountUI.Instance != null)
             {
                 ActivityTossDiscountUI.Instance.updateTimeCoundDown(string.Empty);
                 ActivityTossDiscountUI.Instance.initYingBiSpine();
                 ActivityTossDiscountUI.Instance.initView();
                 ActivityTossDiscountUI.Instance.RefreshUI();
             }
         }
     }, true);
 }
 public void ResetTimeCountDown(int seconds)
 {
     if (this.timeCountDown == null)
     {
         this.timeCountDown = new TimeCountDown(seconds, TimeFormat.SECOND, delegate
         {
             if (MemCollabUIView.Instance != null && MemCollabUIView.Instance.get_gameObject().get_activeSelf() && this.timeCountDown != null)
             {
                 MemCollabUIView.Instance.SetTime(this.timeCountDown.GetSeconds());
                 MemCollabUIView.Instance.SetScore(this.timeCountDown.GetSeconds());
             }
         }, delegate
         {
             if (MemCollabUIView.Instance != null && MemCollabUIView.Instance.get_gameObject().get_activeSelf())
             {
                 MemCollabUIView.Instance.SetTimeUseUp(5);
                 MemCollabUIView.Instance.SetScore(300);
             }
         }, false);
     }
     else
     {
         this.timeCountDown.ResetSeconds(seconds);
     }
 }
Example #7
0
 private void SetRemainTimeCD(int remainTime)
 {
     this.RemoveRemainTimeCD();
     if (remainTime > 0)
     {
         this.remainTimeCD = new TimeCountDown(remainTime, TimeFormat.HHMMSS, delegate
         {
             string time = TimeConverter.GetTime(remainTime, TimeFormat.HHMMSS);
             if (this.remainTimeCD != null)
             {
                 time = this.remainTimeCD.GetTime();
             }
             string text = GameDataUtils.GetChineseContent(510116, false);
             text        = text.Replace("{s1}", time + GameDataUtils.GetChineseContent(509003, false));
             this.TextTimeLessDes.set_text(text);
         }, delegate
         {
             this.RemoveRemainTimeCD();
             this.SetGangFightOpenTime();
         }, true);
     }
     else
     {
         this.SetGangFightOpenTime();
     }
 }
Example #8
0
 private void SetKillBossCDTime(int cdTime)
 {
     this.ClearKillBossCDTimeCD();
     if (cdTime <= 0)
     {
         return;
     }
     this.killBossCDTimeCD = new TimeCountDown(cdTime, TimeFormat.HHMMSS, delegate
     {
         if (this.killBossCDTimeCD != null)
         {
             if (GuildBossManager.Instance.GuildBossActivityInfo != null)
             {
                 GuildBossManager.Instance.GuildBossActivityInfo.CanKillBossCD = this.killBossCDTimeCD.GetSeconds();
             }
             this.coolDownText.set_text("距离下次击杀BOSS还剩:" + this.killBossCDTimeCD.GetTime());
         }
     }, delegate
     {
         if (GuildBossManager.Instance.GuildBossActivityInfo != null)
         {
             GuildBossManager.Instance.GuildBossActivityInfo.CanKillBossCD = 0;
         }
         this.coolDownText.set_text(string.Empty);
         this.RefreshUI();
         this.ClearKillBossCDTimeCD();
     }, true);
 }
Example #9
0
 private void SetDownTime(MailInfo mailInfo)
 {
     this.DownTime = string.Empty;
     if (this.m_TimeCountDown != null)
     {
         if (mailInfo.timeoutSec > 0)
         {
             this.m_TimeCountDown.ResetSeconds(mailInfo.timeoutSec);
         }
         else
         {
             this.m_TimeCountDown.Dispose();
             this.m_TimeCountDown = null;
         }
     }
     else if (mailInfo.timeoutSec > 0)
     {
         this.m_TimeCountDown = new TimeCountDown(mailInfo.timeoutSec, TimeFormat.DHHMM_Chinese, delegate
         {
             if (MailUIViewModel.Instance != null && MailUIViewModel.Instance.get_gameObject().get_activeSelf())
             {
                 string color  = TextColorMgr.GetColor(this.m_TimeCountDown.GetTime(), "ff7d4b", string.Empty);
                 this.DownTime = color + "后自动删除";
             }
         }, delegate
         {
             if (MailUIViewModel.Instance != null && MailUIViewModel.Instance.get_gameObject().get_activeSelf())
             {
                 this.DownTime = string.Empty;
             }
         }, true);
     }
 }
Example #10
0
 public void ResetTimeCountDown(int seconds)
 {
     if (this.timeCountDown == null)
     {
         if (seconds > 0)
         {
             this.timeCountDown = new TimeCountDown(seconds, TimeFormat.SECOND, delegate
             {
                 this.mailInfo.timeoutSec = this.timeCountDown.GetSeconds();
             }, delegate
             {
                 this.mailInfo.timeoutSec = this.timeCountDown.GetSeconds();
                 MailManager.Instance.SendDelMail(this.mailInfo.id);
             }, true);
         }
     }
     else if (seconds > 0)
     {
         this.timeCountDown.ResetSeconds(seconds);
     }
     else
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
 }
Example #11
0
 private void RemoveTitleRemainTimeCD()
 {
     if (this.titleRemianTimeCd != null)
     {
         this.titleRemianTimeCd.Dispose();
         this.titleRemianTimeCd = null;
     }
 }
Example #12
0
 private void RemoveActivityCountDown()
 {
     if (this.activityRemainCD != null)
     {
         this.activityRemainCD.Dispose();
         this.activityRemainCD = null;
     }
 }
Example #13
0
 public void RemoveTramcarCountDown()
 {
     if (this.mTimeCountDown != null)
     {
         this.mTimeCountDown.Dispose();
         this.mTimeCountDown = null;
     }
 }
Example #14
0
 public void RemoveZeroTaskCountDown()
 {
     if (this.mFreeTimesCountDown != null)
     {
         this.mFreeTimesCountDown.Dispose();
         this.mFreeTimesCountDown = null;
     }
 }
Example #15
0
 public void RemoveLootCountDown()
 {
     if (this.mLootTimeCountDown != null)
     {
         this.mLootTimeCountDown.Dispose();
         this.mLootTimeCountDown = null;
     }
 }
 private void ClearExitCountDown()
 {
     if (this.exitCoundDown != null)
     {
         this.exitCoundDown.Dispose();
         this.exitCoundDown = null;
     }
 }
Example #17
0
 private void ClearTimeCoundDown()
 {
     if (this.timeCoundDown != null)
     {
         this.timeCoundDown.Dispose();
         this.timeCoundDown = null;
     }
 }
Example #18
0
 public void RemoveBossBookCountDown()
 {
     if (this.bossBookCD != null)
     {
         this.bossBookCD.Dispose();
         this.bossBookCD = null;
     }
 }
Example #19
0
 private void RemoveRemainTimeCD()
 {
     if (this.remainTimeCD != null)
     {
         this.remainTimeCD.Dispose();
         this.remainTimeCD = null;
     }
 }
Example #20
0
 private void StopCountDown()
 {
     if (this.timeCountDown != null)
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
 }
Example #21
0
 private void RemoveNextCompleteCD()
 {
     if (this.timeCountDown != null)
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
 }
Example #22
0
 public void RemoveGuildBossBattleCountDown()
 {
     if (this.guildBossBattleCD != null)
     {
         this.guildBossBattleCD.Dispose();
         this.guildBossBattleCD = null;
     }
 }
Example #23
0
 private void ClearKillBossCDTimeCD()
 {
     this.coolDownText.set_text(string.Empty);
     if (this.killBossCDTimeCD != null)
     {
         this.killBossCDTimeCD.Dispose();
         this.killBossCDTimeCD = null;
     }
 }
Example #24
0
 protected override void OnDestroy()
 {
     if (this.timeCountDown != null)
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
     base.OnDestroy();
 }
Example #25
0
    public override void initialization()
    {
        base.initialization();
        if (instance == null)
        {
            instance = this;
        }

        HideAll();
    }
Example #26
0
        public void CreateTimer(ref TimeCountDown timeCountDown, Vector3 pos)
        {
            GameObject newTimer = Instantiate(timer, timerList);

            newTimer.SetActive(false);
            (newTimer.transform as RectTransform).anchoredPosition = UiTool.GetTowerUiPos(transform, UiCamera, pos);
            newTimer.name = "TimerCount" + timeCountList.Count;
            timeCountList.Add(newTimer);
            timeCountDown = newTimer.GetComponent <TimeCountDown>();
        }
Example #27
0
 private void AddTramcarCountDown(int remianTime)
 {
     this.RemoveTramcarCountDown();
     if (remianTime <= 0)
     {
         this.OnCountdownEnd();
         return;
     }
     this.mTimeCountDown = new TimeCountDown(remianTime, TimeFormat.SECOND, new Action(this.OnCountdown), new Action(this.OnCountdownEnd), true);
 }
Example #28
0
 public void Release()
 {
     this.teamChatList = null;
     this.IsInCD       = false;
     if (this.timeCountDown != null)
     {
         this.timeCountDown.Dispose();
         this.timeCountDown = null;
     }
     this.RemoveListeners();
 }
Example #29
0
    public override void EndingCountdown(Action onCountdownEnd)
    {
        if (!InstanceManager.IsShowInstanceDrop && !InstanceManager.IsShowMonsterDrop)
        {
            if (onCountdownEnd != null)
            {
                onCountdownEnd.Invoke();
            }
            return;
        }
        if (base.InstanceData.endTime <= 1000)
        {
            if (onCountdownEnd != null)
            {
                onCountdownEnd.Invoke();
            }
            return;
        }
        float cameraTime = float.Parse(DataReader <GlobalParams> .Get("instanceEndCameraTime").value);

        this.cameraTimer = TimerHeap.AddTimer((uint)cameraTime, 0, delegate
        {
            float num = (float)this.InstanceData.endTime - cameraTime;
            if (num <= 1000f)
            {
                if (onCountdownEnd != null)
                {
                    onCountdownEnd.Invoke();
                }
                return;
            }
            UIManagerControl.Instance.OpenUI("DungeonCountDownUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush);
            if (DungeonCountDownUI.Instance != null)
            {
                DungeonCountDownUI.Instance.UpdateNum((int)(num * 0.001f));
            }
            this.timeCountDown = new TimeCountDown((int)(num * 0.001f), TimeFormat.SECOND, delegate
            {
                if (DungeonCountDownUI.Instance != null)
                {
                    DungeonCountDownUI.Instance.UpdateNum(this.timeCountDown.GetSeconds());
                }
            }, delegate
            {
                this.timeCountDown.Dispose();
                this.timeCountDown = null;
                UIManagerControl.Instance.UnLoadUIPrefab("DungeonCountDownUI");
                if (onCountdownEnd != null)
                {
                    onCountdownEnd.Invoke();
                }
            }, true);
        });
    }
Example #30
0
 private void AddLootCountDown(int remianTime)
 {
     this.RemoveLootCountDown();
     this.mLootTimeCountDown = new TimeCountDown(remianTime, TimeFormat.SECOND, delegate
     {
         this.mTxCountDown.set_text(this.mStrCD + TimeConverter.GetTime(this.mLootTimeCountDown.GetSeconds(), TimeFormat.MMSS));
     }, delegate
     {
         this.mTxCountDown.set_text(this.mStrCD + "00:00");
     }, true);
 }