From 89339ffb2975657745b13a70976810f8bd841bc2 Mon Sep 17 00:00:00 2001 From: yashihei Date: Sun, 14 Jun 2020 06:11:40 +0900 Subject: [PATCH] Fixed CancelationToken not being passed correctly --- .../Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs | 1 + .../Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs index ddd0751..585fff9 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs @@ -34,6 +34,7 @@ namespace Cysharp.Threading.Tasks.Linq public _EveryUpdate(PlayerLoopTiming updateTiming, CancellationToken cancellationToken) { this.updateTiming = updateTiming; + this.cancellationToken = cancellationToken; TaskTracker.TrackActiveTask(this, 2); PlayerLoopHelper.AddAction(updateTiming, this); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs index 35aaf91..a4869b2 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs @@ -104,6 +104,7 @@ namespace Cysharp.Threading.Tasks.Linq this.dueTimePhase = true; this.updateTiming = updateTiming; this.ignoreTimeScale = ignoreTimeScale; + this.cancellationToken = cancellationToken; TaskTracker.TrackActiveTask(this, 2); PlayerLoopHelper.AddAction(updateTiming, this); } @@ -223,6 +224,7 @@ namespace Cysharp.Threading.Tasks.Linq this.dueTimePhase = true; this.dueTimeFrameCount = dueTimeFrameCount; this.periodFrameCount = periodFrameCount; + this.cancellationToken = cancellationToken; TaskTracker.TrackActiveTask(this, 2); PlayerLoopHelper.AddAction(updateTiming, this);