mirror of https://github.com/Cysharp/UniTask
Merge pull request #457 from sgaumin/wait-for-seconds
Add WaitForSeconds method declarations #371pull/484/head
commit
d210e3d76a
|
@ -111,6 +111,16 @@ namespace Cysharp.Threading.Tasks
|
|||
return UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken);
|
||||
}
|
||||
|
||||
public static UniTask WaitForSeconds(float duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return Delay(Mathf.RoundToInt(1000 * duration), ignoreTimeScale, delayTiming, cancellationToken);
|
||||
}
|
||||
|
||||
public static UniTask WaitForSeconds(int duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return Delay(1000 * duration, ignoreTimeScale, delayTiming, cancellationToken);
|
||||
}
|
||||
|
||||
public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (delayFrameCount < 0)
|
||||
|
|
Loading…
Reference in New Issue