private void Update() { if (_run) { if (!_endTime) { _currentTime -= Time.deltaTime; if (_prevUpdate - _currentTime >= stepUpdate) { _prevUpdate -= stepUpdate; string timeSt = TimeHelp.GetFormattedTime(_prevUpdate, formatTime); eventUpdate?.Invoke(timeSt); } if (_currentTime <= 0.0f) { _endTime = true; _run = false; eventComplete?.Invoke(); } } } }
/// <summary> /// GetTime in format (default MM:SS:MS) /// </summary> /// <returns>The time string</returns> public string GetFormattedTime() { return(TimeHelp.GetFormattedTime(_currentTime, formatTime)); }