示例#1
0
    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();
    }
示例#2
0
 public void OnTimerEnd()
 {
     TimerEndEvent?.Invoke();
 }