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); }
/// <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); } }
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; }
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)); } }
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(); }
// Awake GameObject protected virtual void Awake() { this.m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true); }
// Awake GameObject protected virtual void Awake() { this.controlData = new CObjectData(); this.m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true); this.uID = string.Empty; }
// Start GameObject protected virtual void Start() { m_NetworkManager = CNetworkManager.GetInstance(); m_CountDownFixedTimeSync = new CountdownTime(m_FixedTimeSync, true); OnCreateControlObject(); }
void Awake() { Time = new CountdownTime { Active = false }; }