breaking changes, UniTask.WaitForFixedUpdate wait at LastFixedUpdate #377

master
neuecc 2022-10-24 21:18:36 +09:00
parent a879989d1c
commit dc804ffb13
1 changed files with 6 additions and 4 deletions

View File

@ -94,19 +94,21 @@ namespace Cysharp.Threading.Tasks
} }
/// <summary> /// <summary>
/// Same as UniTask.Yield(PlayerLoopTiming.FixedUpdate). /// Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate).
/// </summary> /// </summary>
public static YieldAwaitable WaitForFixedUpdate() public static YieldAwaitable WaitForFixedUpdate()
{ {
return UniTask.Yield(PlayerLoopTiming.FixedUpdate); // use LastFixedUpdate instead of FixedUpdate
// https://github.com/Cysharp/UniTask/issues/377
return UniTask.Yield(PlayerLoopTiming.LastFixedUpdate);
} }
/// <summary> /// <summary>
/// Same as UniTask.Yield(PlayerLoopTiming.FixedUpdate, cancellationToken). /// Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken).
/// </summary> /// </summary>
public static UniTask WaitForFixedUpdate(CancellationToken cancellationToken) public static UniTask WaitForFixedUpdate(CancellationToken cancellationToken)
{ {
return UniTask.Yield(PlayerLoopTiming.FixedUpdate, cancellationToken); return UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken);
} }
public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))