mirror of https://github.com/Cysharp/UniTask
Removed CancelAfterSlim(bool ignoreTimeScale), changed to CancelAfterSlim(DelayType delayType)
parent
0a447e43b0
commit
ab76098895
|
@ -36,6 +36,7 @@ namespace Cysharp.Threading.Tasks
|
||||||
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
||||||
}
|
}
|
||||||
cts.Cancel();
|
cts.Cancel();
|
||||||
|
cts.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (UniTask, CancellationTokenRegistration) ToUniTask(this CancellationToken cancellationToken)
|
public static (UniTask, CancellationTokenRegistration) ToUniTask(this CancellationToken cancellationToken)
|
||||||
|
|
|
@ -9,15 +9,15 @@ namespace Cysharp.Threading.Tasks
|
||||||
{
|
{
|
||||||
public static class CancellationTokenSourceExtensions
|
public static class CancellationTokenSourceExtensions
|
||||||
{
|
{
|
||||||
public static void CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
|
public static void CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
|
||||||
{
|
{
|
||||||
var delay = UniTask.Delay(millisecondsDelay, ignoreTimeScale, delayTiming, cts.Token);
|
var delay = UniTask.Delay(millisecondsDelay, delayType, delayTiming, cts.Token);
|
||||||
CancelAfterCore(cts, delay).Forget();
|
CancelAfterCore(cts, delay).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
|
public static void CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
|
||||||
{
|
{
|
||||||
var delay = UniTask.Delay(delayTimeSpan, ignoreTimeScale, delayTiming, cts.Token);
|
var delay = UniTask.Delay(delayTimeSpan, delayType, delayTiming, cts.Token);
|
||||||
CancelAfterCore(cts, delay).Forget();
|
CancelAfterCore(cts, delay).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue