public IEnumerator Stop() { var executer = new CoroutineExecuterGameObject(); var runner = new CoroutineRunner(executer); executer.Initialize(); runner.Start(WaitForUpdateRoutine(10)); yield return(null); yield return(null); yield return(null); yield return(null); Assert.True(runner.IsRunning); runner.Stop(); Assert.False(runner.IsRunning); yield return(null); Assert.False(runner.IsRunning); executer.Uninitialize(); }
public override void EndTurn() { if (activeCoroutine != null) { CoroutineRunner.Stop(activeCoroutine); } base.EndTurn(); }
/// <summary> /// Deactivate session data polling /// </summary> public void DeactivateStatusPolling() { statusPollingActive = false; statusPollingCallback = null; if (statusPollingCoroutine != null) { coroutineRunner.Stop(statusPollingCoroutine); statusPollingCoroutine = null; } }
private void StopMaintainConnection() { if (maintainConnectionCoroutine == null) { return; } this.reconnectOnClose = false; coroutineRunner.Stop(this.maintainConnectionCoroutine); this.maintainConnectionCoroutine = null; }
private void OnGUI() { if (_coroutine == null) { EditorGUILayout.HelpBox("There is currently no coroutine running. Click the button to start a coroutine in the editor.", MessageType.None); if (GUILayout.Button("Start Coroutine")) { _coroutine = _runner.Start(MyCoroutine()); } } else { EditorGUILayout.HelpBox("The coroutine is currently running, you can check the logs for the output.", MessageType.Info); if (GUILayout.Button("Stop Coroutine")) { _runner.Stop(_coroutine); _coroutine = null; } } }
public void Destroy() { CoroutineRunner.Stop(_coroutine); }