Fix AwakeMonitor to not duplicates

master
hadashiA 2023-09-08 09:36:42 +09:00
parent 7fae415689
commit a7a6af0a68
1 changed files with 4 additions and 6 deletions

View File

@ -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;
} }
} }