Using that simple code:
IEnumerator EOF () {
yield return null; // wait one frame so that SceneView focuses
yield return new WaitForEndOfFrame (); // steping will hang here unless you focus GameView again
Debug.Log ("Got here!");
}
void OnGUI () {
if (GUILayout.Button ("Test")) {
Debug.Break ();
StartCoroutine (EOF ());
}
}
Using default layout (where Scene and Game are tabbed, so you can’t see both at the same time), if I hit Play from the SceneView, and hit the Test button, I’d get to a paused state of the game and my SceneView focused.
If I try to step though my coroutine, I never get passed yield return new WaitForEndOfFrame ();
unless I switch to GameView again.
No matter how many times I hit Step, the game gets paused there. Even the profiler stops reporting (despite frames keep counting).
Is this a bug?