public Coroutine Await() { Assert.IsTrue(_coroutine != null || Completed, "Start must be called before awaiting coroutine"); if (Completed) { return(WooroutineRunner.StartRoutine(YieldOnCoroutine())); } Coroutine co; if (_awaitCoroutines == null) { _awaitCoroutines = new List <Coroutine>(); co = WooroutineRunner.StartRoutine(YieldOnCoroutine()); } else { co = WooroutineRunner.StartRoutine(YieldOnResultRoutine()); } _awaitCoroutines.Add(co); return(co); }
public void Stop() { if (_awaitCoroutines != null) { foreach (var awaitRoutine in _awaitCoroutines) { WooroutineRunner.StopRoutine(awaitRoutine); } } if (_coroutine != null) { WooroutineRunner.StopRoutine(_coroutine); SendCanceled(); } Clear(); }
void OnDestroy() { _coroutineRunner = null; }
public static void PrepareForReset() { Instance.StopAllCoroutines(); DestroyImmediate(_coroutineRunner); _coroutineRunner = null; }
public Wooroutine <T> Start() { _coroutine = WooroutineRunner.StartRoutine(WrapRoutine()); return(this); }