public void ResetTime() { m_CountDownTime = m_OriCountDownTime; Global.gApp.gMsgDispatcher.Broadcast <string, string>(MsgIds.FightUiModeCountDownTips, m_Tips, UiTools.FormatTime(m_CountDownTime)); }
protected float BroadCoolDown(float time, bool endBroad = false) { float dtTime = BaseScene.GetDtTime(); time -= dtTime; m_CurTime += dtTime; if (m_CurTime > m_UpdateDt) { m_CurTime = 0; if (time > 0) { Global.gApp.gMsgDispatcher.Broadcast <string, string>(MsgIds.FightUiModeCountDownTips, m_Tips, UiTools.FormatTime(time)); } } if (time <= 11f) { m_CurClipTime += dtTime; if (m_CurClipTime >= 1) { m_CurClipTime -= 1; Global.gApp.gAudioSource.PlayOneShot(CountDownClipName, true); } } if (time <= 0 && endBroad) { Global.gApp.gMsgDispatcher.Broadcast <string, string>(MsgIds.FightUiModeCountDownTips, GameConstVal.EmepyStr, GameConstVal.EmepyStr); EndTask(); } return(time); }