How to reproduce:
- Open the attached “repro-IN-149066.zip” project
- Enter Play Mode
- Open EditMeDuringPlayMode.cs in an external code editor
- Make a minor change to the script and save the file
- Return to Unity and exit Play Mode
- Observe the Console
Actual result: The Console throws the following errors "Mismatched state in DefaultScenario, was Stopping but expected Idle", "Tried to enter EditModeScope while already in EditModeScope", and "Lifecycle ERROR : could not enter scope 'EditMode' as it is already active."
Expected result: The Editor cleanly exits Play Mode and returns to Edit Mode without throwing any errors
Reproducible with: 6000.5.6f1, 6000.6.0a3, 6000.6.0b6, 6000.7.0a3
Not reproducible with: 6000.0.80f1, 6000.3.21f1, 6000.6.0a2 (64de5ee36373)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Workaround: Navigate to Edit -> Preferences -> General and change the "Script Changes While Playing" setting to "Recompile And Continue Playing"
Notes:
- Depending on the version, you will see either all three errors, only the first one, or only the latter two. Please see the Internal Notes for the exact version breakdown
- Edit -> Preferences -> General -> "Script Changes While Playing" should be set to "Recompile After Finished Playing"