public void Stop() { if (_updateRoutine != null) { _updateRoutine.Cancel(); _fixedUpdateRoutine.Cancel(); } _updateRoutine = null; _fixedUpdateRoutine = null; }
public void Start(MonoBehaviour behaviour) { if (_updateRoutine != null) { throw new System.InvalidOperationException("Failed to start RadicalCoroutine. The Coroutine is already being processed."); } if (behaviour == null) { throw new System.ArgumentNullException("behaviour"); } _updateRoutine = new CancellableCoroutine(this.Update()); _fixedUpdateRoutine = new CancellableCoroutine(this.FixedUpdate().GetEnumerator()); iteratorFibers = new Fiber[_fibers.Count]; behaviour.StartCoroutine(_updateRoutine); behaviour.StartCoroutine(_fixedUpdateRoutine); }