//重置接口 public void Reset() { IsStart = false; IsPause = false; //新增这一行↓ CenterTimer.RemoveTimer(this); }
void End() { IsStart = false; if (OnEnd != null) { OnEnd(); } CenterTimer.RemoveTimer(this); }
//计时器结束 void End() { IsStart = false; FinishCount++; if (OnEnd != null) { OnEnd(); } //新增这一行↓ CenterTimer.RemoveTimer(this); }
public void Start() { IsStart = true; StartTime = Time.time; CurTime = StartTime; EndTime = StartTime + Duration; CenterTimer.AddTimer(this); if (OnStart != null) { OnStart(); } }