예제 #1
0
        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);
        }
예제 #2
0
        public void Stop()
        {
            if (_awaitCoroutines != null)
            {
                foreach (var awaitRoutine in _awaitCoroutines)
                {
                    WooroutineRunner.StopRoutine(awaitRoutine);
                }
            }
            if (_coroutine != null)
            {
                WooroutineRunner.StopRoutine(_coroutine);
                SendCanceled();
            }

            Clear();
        }
예제 #3
0
 void OnDestroy()
 {
     _coroutineRunner = null;
 }
예제 #4
0
 public static void PrepareForReset()
 {
     Instance.StopAllCoroutines();
     DestroyImmediate(_coroutineRunner);
     _coroutineRunner = null;
 }
예제 #5
0
 public Wooroutine <T> Start()
 {
     _coroutine = WooroutineRunner.StartRoutine(WrapRoutine());
     return(this);
 }