mirror of https://github.com/Cysharp/UniTask
Fix AwakeMonitor to not duplicates
parent
7fae415689
commit
a7a6af0a68
|
@ -32,13 +32,11 @@ namespace Cysharp.Threading.Tasks.Triggers
|
||||||
if (cancellationTokenSource == null)
|
if (cancellationTokenSource == null)
|
||||||
{
|
{
|
||||||
cancellationTokenSource = new CancellationTokenSource();
|
cancellationTokenSource = new CancellationTokenSource();
|
||||||
}
|
|
||||||
|
|
||||||
if (!awakeCalled)
|
if (!awakeCalled)
|
||||||
{
|
{
|
||||||
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this));
|
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return cancellationTokenSource.Token;
|
return cancellationTokenSource.Token;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue