private IEnumerator StartHandler(CoroutineWrapper rCoroutineWrapper, IEnumerator rIEnum) { yield return(this.StartCoroutine(rIEnum)); rCoroutineWrapper.IsRunning = false; rCoroutineWrapper.IsCompleted = true; // @TODO: 可能会出问题的地方,自己把自己删掉,并将对应的数据都清空 CoroutineManager.Instance.Stop(rCoroutineWrapper); }
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); }
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; } }
public void Start(IEnumerator rIEnum) { mCoroutineWrapper = CoroutineManager.Instance.StartWrapper(rIEnum); }