Prevent UnitTasks from continuing after exiting play mode #22

This commit is contained in:
neuecc
2019-06-28 20:41:04 +09:00
parent 021a1da1fa
commit f82c762263
3 changed files with 20 additions and 10 deletions

View File

@@ -67,13 +67,33 @@ namespace UniRx.Async
var yieldLoop = new PlayerLoopSystem
{
type = loopRunnerYieldType,
#if UNITY_EDITOR
updateDelegate = () =>
{
if (Application.isPlaying)
{
cq.Run();
}
}
#else
updateDelegate = cq.Run
#endif
};
var runnerLoop = new PlayerLoopSystem
{
type = loopRunnerType,
#if UNITY_EDITOR
updateDelegate = () =>
{
if (Application.isPlaying)
{
runner.Run();
}
}
#else
updateDelegate = runner.Run
#endif
};
var dest = new PlayerLoopSystem[loopSystem.subSystemList.Length + 2];