This commit is contained in:
neuecc
2020-06-08 01:45:57 +09:00
parent 2337d705ec
commit 680ce1098b
5 changed files with 161 additions and 32 deletions

View File

@@ -197,7 +197,7 @@ namespace Cysharp.Threading.TasksTests
//await UniTask.SwitchToThreadPool();
@@ -369,6 +369,24 @@ namespace Cysharp.Threading.TasksTests
throw new Exception("MyException");
}
[UnityTest]
public IEnumerator NextFrame1() => UniTask.ToCoroutine(async () =>
{
await UniTask.Yield(PlayerLoopTiming.LastUpdate);
var frame = Time.frameCount;
await UniTask.NextFrame();
Time.frameCount.Should().Be(frame + 1);
});
[UnityTest]
public IEnumerator NextFrame2() => UniTask.ToCoroutine(async () =>
{
await UniTask.Yield(PlayerLoopTiming.PreUpdate);
var frame = Time.frameCount;
await UniTask.NextFrame();
Time.frameCount.Should().Be(frame + 1);
});
[UnityTest]
public IEnumerator NestedEnumerator() => UniTask.ToCoroutine(async () =>
{