示例#1
0
        protected override void Awake()
        {
            base.Awake();
            m_ChatQueue         = new List <string> ();
            m_EmotionQueue      = new List <string> ();
            m_ChatTextCountdown = new CountdownTime(m_ChatShowTimeInterval, true);
            m_EmotionCountdown  = new CountdownTime(m_EmotionShowTimeInterval, true);

            m_UIEmotionImage.gameObject.SetActive(false);
        }
示例#2
0
 /// <summary>
 /// 检查显示时间
 /// </summary>
 /// <param name="text">文本字段</param>
 /// <param name="deadline"></param>
 private void CheckShowTime(TMP_Text text, CountdownTime info)
 {
     if (ServerTimeUtil.Instance.GetNowTime() < info.deadline)
     {
         text.text = info.text + " " + $"[{TimeUtil.GetTimeStr((long)info.deadline - (long)ServerTimeUtil.Instance.GetNowTime())}]";
         //text.gameObject.SetActive(true);
     }
     else
     {
         //text.gameObject.SetActive(false);
         m_TimeTextDic.Remove(text);
     }
 }
示例#3
0
 public virtual void UpdateText()
 {
     LevelText.text   = $"LEVEL {UpgradeLevel}";
     UpgradeText.text = CurrencyResources.CurrencyToString(UpgradeCost, true);
     IncomeText.text  = CurrencyResources.CurrencyToString(Income, true);
     if (TimeUntilIncome > 59)
     {
         var time = new CountdownTime(Mathf.Round(TimeUntilIncome));
         TimeText.text = string.Format("{0:D2}:{1:D2}:{2:D2}", time.Hours, time.Minutes, time.Seconds);
     }
     else
     {
         TimeText.text = string.Format("00:00:{0:D2}", Mathf.RoundToInt(TimeUntilIncome));
     }
 }
        public SetCustomCountdownPage()
        {
            this.InitializeComponent();

            if (Settings.Current.ShowSeconds)
            {
                VisualStateManager.GoToState(this, "ShowSeconds", true);
            }

            // initialize user times plus a current countdown time
            currentCountdownTime = new CountdownTime();
            userTimes            = new UserTimes();

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }
示例#5
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is CountdownTime)
            {
                soundPlayer = new SoundPlayer();
                await soundPlayer.InitializeSounds();

                // set current time to start time passed in from previous page
                countdownCurrTime = e.Parameter as CountdownTime;

                // start the timer with the current time
                StartTimer(countdownCurrTime);

                // divide 100 by the total number of minutes to get percentage interval for background animation
                percentageInterval = (100 / ((double)(countdownCurrTime.Minutes * 60) + countdownCurrTime.Seconds));
            }
        }
示例#6
0
        private void StartTimer(CountdownTime time)
        {
            // get the timer ready
            timer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };

            timer.Tick += Timer_Tick;

            // time stamps to keep our pseudo clock honest
            currTime = DateTime.Now;

            // start the timer
            timer.Start();

            // set clock strings to starting values
            clockMinuteText.Text = ((time.Minutes < 10 && !minutesOnly) ? "0" : "") + time.Minutes.ToString();
            clockSecondText.Text = ((time.Seconds < 10) ? "0" : "") + time.Seconds.ToString();
        }
示例#7
0
 // Awake GameObject
 protected virtual void Awake()
 {
     this.m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true);
 }
示例#8
0
 // Awake GameObject
 protected virtual void Awake()
 {
     this.controlData = new CObjectData();
     this.m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true);
     this.uID = string.Empty;
 }
示例#9
0
 // Start GameObject
 protected virtual void Start()
 {
     m_NetworkManager         = CNetworkManager.GetInstance();
     m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true);
     OnCreateControlObject();
 }
示例#10
0
 void Awake()
 {
     Time = new CountdownTime {
         Active = false
     };
 }