private IEnumerator Run() { if (m_CoroutineContainer == null) { yield break; } float elapsedTime = 0.0f; while (elapsedTime < m_Duration) { elapsedTime += m_ignoreTimeScale?Time.unscaledDeltaTime : Time.deltaTime; float precentage = Mathf.Clamp01(elapsedTime / m_Duration); if (m_Target != null) { m_Target.Invoke(precentage); } yield return(null); } m_Target.Invoke(1.0f); m_TimerEnd.Invoke(); }
public void OnTimerEnd() { TimerEndEvent?.Invoke(); }