There is a way to save your scene before killing the app.
If you can get a breakpoint in your infinite loop, by attaching the debugger, type this in the immediate window..
EditorApplication.SaveScene("Assets/MyNewScene.unity");
Then press play again. Hit your breakpoint again.
Type it again to make sure, then look in your assets folder.
Then to quit the editor, type
EditorApplication.Exit(0);
I tried this with a FixedUpdate() containing
while (true) {
int x=0;
x=x+1;
Debug.Log ( x.ToString() );
}
↧