public void Start() { if (IsRunning) { return; } // Start coroutine. timerCoroutine = UnityThread.StartCoroutine(TimerRoutine()); }
public void Pause() { if (!IsRunning) { return; } // Stop coroutine. UnityThread.StopCoroutine(timerCoroutine); timerCoroutine = null; }
/// <summary> /// Starts running the async operation. /// </summary> private void StartRunner() { curOperation = runner?.Invoke(); if (curOperation == null) { SetProgress(1f); SetFinished(); return; } UnityThread.StartCoroutine(PollProgress()); curOperation.completed += OnOperationComplete; }