Run DelayFrame on UnityEditor
parent
b089f74c65
commit
5c668717d8
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue