diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs index 28babed..b459861 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs @@ -143,8 +143,6 @@ namespace Cysharp.Threading.Tasks.Internal { var j = tail - 1; - var loopItems = this.loopItems; - // eliminate array-bound check for i for (int i = 0; i < loopItems.Length; i++) { var action = loopItems[i]; diff --git a/src/UniTask/Assets/Tests/DelayTest.cs b/src/UniTask/Assets/Tests/DelayTest.cs index 7102f4e..3040341 100644 --- a/src/UniTask/Assets/Tests/DelayTest.cs +++ b/src/UniTask/Assets/Tests/DelayTest.cs @@ -200,5 +200,16 @@ namespace Cysharp.Threading.TasksTests okay1.Should().Be(true); okay2.Should().Be(true); }); + + + [UnityTest] + public IEnumerator LoopTest() => UniTask.ToCoroutine(async () => + { + for (int i = 0; i < 20; ++i) + { + UniTask.DelayFrame(100).Forget(); + await UniTask.DelayFrame(1); + } + }); } } \ No newline at end of file