Exemple #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);
        }
Exemple #2
0
 public Wooroutine <T> Start()
 {
     _coroutine = WooroutineRunner.StartRoutine(WrapRoutine());
     return(this);
 }