fix: ticker behaviour working unexpectedly on instances where time increment is bigger than the period
This commit is contained in:
parent
80202d4a07
commit
bfbcfdce4f
@ -20,12 +20,12 @@ public class TickerBehaviour : StopwatchBehaviour, ITicker
|
||||
{
|
||||
base.OnUpdate();
|
||||
|
||||
if (Time < nextTick)
|
||||
return;
|
||||
|
||||
nextTick += Period;
|
||||
TickCounter++;
|
||||
OnTick?.Invoke(this);
|
||||
while (Time > nextTick)
|
||||
{
|
||||
nextTick += Period;
|
||||
TickCounter++;
|
||||
OnTick?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnFinalize()
|
||||
|
Loading…
x
Reference in New Issue
Block a user