You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uloop control-play-mode --action Play quietly saves every dirty loaded Scene (and the current Prefab Stage) before entering Play Mode from Edit Mode (ControlPlayModeUseCase.SaveDirtyEditorChangesBeforePlayStart, added in #1756). There is no way to opt out, unlike run-tests --unsaved-changes save|fail|discard, and the response does not say that anything was saved (it only reports Play mode started).
Problem
Unity itself does not block entering Play Mode when Scenes have unsaved changes; it keeps them in memory and restores them after Play Mode ends. The CLI saves them anyway, so the Scene file on disk is rewritten on every CLI Play.
This becomes a problem for Scenes that turn dirty just by being opened (for example, layout groups / CanvasScaler recomputing RectTransform values, or objects that recreate themselves in Edit Mode):
Every CLI Play rewrites the Scene file and produces a VCS diff in a Scene the user never edited.
If the Scene already has the user's own uncommitted changes, they get mixed with this noise and the user can no longer tell which changes are theirs.
An agent that enters Play repeatedly for verification rewrites the file each time without noticing, because the response is silent about the save.
Repro
Open a Scene that becomes dirty on load (or make any change and leave it unsaved).
Run uloop control-play-mode --action Play.
The Scene file on disk is rewritten and git status shows it as modified.
Proposal
Add --unsaved-changes to control-play-mode Play, for example:
keep: enter Play Mode without saving (Unity's native behavior)
save: current behavior
fail: stop with the list of unsaved Scenes / Prefab Stage
List the saved Scenes / Prefab Stage in the response whenever a save happens, so callers notice the rewrite.
Summary
uloop control-play-mode --action Playquietly saves every dirty loaded Scene (and the current Prefab Stage) before entering Play Mode from Edit Mode (ControlPlayModeUseCase.SaveDirtyEditorChangesBeforePlayStart, added in #1756). There is no way to opt out, unlikerun-tests --unsaved-changes save|fail|discard, and the response does not say that anything was saved (it only reportsPlay mode started).Problem
Unity itself does not block entering Play Mode when Scenes have unsaved changes; it keeps them in memory and restores them after Play Mode ends. The CLI saves them anyway, so the Scene file on disk is rewritten on every CLI Play.
This becomes a problem for Scenes that turn dirty just by being opened (for example, layout groups / CanvasScaler recomputing RectTransform values, or objects that recreate themselves in Edit Mode):
Repro
uloop control-play-mode --action Play.git statusshows it as modified.Proposal
--unsaved-changestocontrol-play-modePlay, for example:keep: enter Play Mode without saving (Unity's native behavior)save: current behaviorfail: stop with the list of unsaved Scenes / Prefab Stagekeepmatches Unity's native behavior;savestays available for environments where a save dialog would stall the Play start (the motivation of fix: pause-point disconnect no longer leaves Play Mode stuck; quiet-save before CLI Play #1756).Environment