Exemplo n.º 1
0
    IEnumerator UpdateDuration()
    {
        yield return(new WaitForSeconds(DurationInSeconds));

        if (OnDurationEnded != null)
        {
            OnDurationEnded();
            OnDurationEnded = null;
        }
    }
Exemplo n.º 2
0
 public Timer(DurationCallback callbackDelegate)
 {
     m_updateCallback = callbackDelegate;
     m_timerState     = TIMER_STATE.TS_START;
 }
Exemplo n.º 3
0
 public void Start(DurationCallback callback)
 {
     OnDurationEnded = callback;
     MonoBehaviorHost.Instance.StartCoroutine(UpdateDuration());
 }