示例#1
0
 static CoroutineManager()
 {
     if (coroutine == null)
     {
         coroutine = new GameObject("CoroutineManager").AddComponent <InnerCoroutine>();
         GameObject.DontDestroyOnLoad(coroutine);
     }
 }
示例#2
0
        public IEnumerator Start()
        {
            while (InnerCoroutine.MoveNext())
            {
                yield return(InnerCoroutine.Current);
            }

            Completed = true;
        }
        protected virtual void StartWait(float timeout, bool ignoreTimeScale = false)
        {
            var iEnumerator = Wait.WaitFor(() =>
            {
                if (Check())
                {
                    return(new WaitSuccess());
                }
                return(new WaitFailed(errorMessage));
            }, timeout, ignoreTimeScale: ignoreTimeScale);

            innerCroutine = new InnerCoroutine(iEnumerator, OnCompleteCallback);
            CoroutineProvider.Mono.StartCoroutine(innerCroutine);
        }
示例#4
0
 public void Reset()
 {
     InnerCoroutine.Reset();
 }
示例#5
0
 public bool MoveNext()
 {
     return(InnerCoroutine.MoveNext());
 }
示例#6
0
 public CoroutineManager()
 {
     innerCoroutine = new GameObject("_Coroutine").AddComponent <InnerCoroutine>();
     waits          = new Dictionary <float, WaitForSeconds>();
 }