| | |
| | |
|
| | | float secondTimer = 0f;
|
| | |
|
| | | public void Begin(DateTime _endTime, Action _callBack = null)
|
| | | public void Begin(int seconds, Action _callBack = null)
|
| | | {
|
| | | endTime = _endTime;
|
| | | endTime = TimeUtility.ServerNow + new TimeSpan(seconds * TimeSpan.TicksPerSecond);
|
| | | onTime = _callBack;
|
| | | if (endTime > DateTime.Now)
|
| | | if (endTime > TimeUtility.ServerNow)
|
| | | {
|
| | | this.gameObject.SetActive(true);
|
| | | UpdateTimeShow();
|
| | |
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | if (DateTime.Now > endTime)
|
| | | if (TimeUtility.ServerNow > endTime)
|
| | | {
|
| | | if (onTime != null)
|
| | | {
|
| | |
| | |
|
| | | protected virtual void UpdateTimeShow()
|
| | | {
|
| | | var lastSecond = (float)(endTime - DateTime.Now).TotalSeconds;
|
| | | var lastSecond = (float)(endTime - TimeUtility.ServerNow).TotalSeconds;
|
| | |
|
| | | switch (m_Pattern)
|
| | | {
|