Skip to content

Commit

Permalink
fix: 1フレームの間に2回更新処理が行われることがあるのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubuns committed Dec 23, 2021
1 parent dc77efd commit 390e0d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/AnimeTask/Scripts/Anime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private static async UniTask PlayInternal<T>(IAnimator<T> animator, ITranslator<
var (t, used) = animator.Update(time);
translator.Update(t);
if (used < time) break;
await UniTask.Yield(PlayerLoopTiming.Update, cancellationToken);
await UniTask.NextFrame(PlayerLoopTiming.Update, cancellationToken);
time += scheduler.DeltaTime;
}

Expand Down Expand Up @@ -63,7 +63,7 @@ private static async UniTask DelayInternal(float duration, IScheduler scheduler,
while (!cancellationToken.IsCancellationRequested && !skipToken.IsSkipRequested && playState == Application.isPlaying)
{
if (duration < time) break;
await UniTask.Yield(PlayerLoopTiming.Update, cancellationToken);
await UniTask.NextFrame(PlayerLoopTiming.Update, cancellationToken);
time += scheduler.DeltaTime;
}
cancellationToken.ThrowIfCancellationRequested();
Expand Down

0 comments on commit 390e0d7

Please sign in to comment.