예제 #1
0
        private IEnumerator StartHandler(CoroutineWrapper rCoroutineWrapper, IEnumerator rIEnum)
        {
            yield return(this.StartCoroutine(rIEnum));

            rCoroutineWrapper.IsRunning   = false;
            rCoroutineWrapper.IsCompleted = true;
            // @TODO: 可能会出问题的地方,自己把自己删掉,并将对应的数据都清空
            CoroutineManager.Instance.Stop(rCoroutineWrapper);
        }
예제 #2
0
        public CoroutineWrapper StartHandler(IEnumerator rIEnum)
        {
            CoroutineWrapper rCoroutineWrapper = new CoroutineWrapper();

            rCoroutineWrapper.IsCompleted = false;
            rCoroutineWrapper.IsRunning   = true;
            rCoroutineWrapper.Coroutine   = this.StartCoroutine(StartHandler(rCoroutineWrapper, rIEnum));
            rCoroutineWrapper.Handler     = this;
            return(rCoroutineWrapper);
        }
예제 #3
0
 public void Stop(CoroutineWrapper rCoroutineWrapper)
 {
     if (rCoroutineWrapper != null)
     {
         if (rCoroutineWrapper.Handler != null)
         {
             rCoroutineWrapper.Handler.StopAllCoroutines();
             GameObject.DestroyImmediate(rCoroutineWrapper.Handler.gameObject);
         }
         rCoroutineWrapper.Coroutine = null;
         rCoroutineWrapper.Handler   = null;
     }
 }
예제 #4
0
 public void Start(IEnumerator rIEnum)
 {
     mCoroutineWrapper = CoroutineManager.Instance.StartWrapper(rIEnum);
 }