Run DelayFrame on UnityEditor

pull/369/head
neuecc 2022-03-03 06:23:34 +09:00
parent b089f74c65
commit 5c668717d8
2 changed files with 15 additions and 1 deletions

View File

@ -22,7 +22,9 @@ public static class EditorRunnerChecker
//var r = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().ToUniTask(); //var r = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().ToUniTask();
//Debug.Log(r.downloadHandler.text.Substring(0, 100)); //Debug.Log(r.downloadHandler.text.Substring(0, 100));
await UniTask.Yield(); //await UniTask.Yield();
await UniTask.DelayFrame(30);
Debug.Log("End"); Debug.Log("End");
} }

View File

@ -444,8 +444,20 @@ namespace Cysharp.Threading.Tasks
// skip in initial frame. // skip in initial frame.
if (initialFrame == Time.frameCount) if (initialFrame == Time.frameCount)
{ {
#if UNITY_EDITOR
// force use Realtime.
if (PlayerLoopHelper.IsMainThread && !UnityEditor.EditorApplication.isPlaying)
{
//goto ++currentFrameCount
}
else
{
return true; return true;
} }
#else
return true;
#endif
}
} }
if (++currentFrameCount >= delayFrameCount) if (++currentFrameCount >= delayFrameCount)