Version: 2022.1
LanguageEnglish
  • C#

EnterPlayModeOptions.DisableSceneBackupUnlessDirty

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

When enabled, this reduces the time taken to enter play mode by only backing up scenes marked dirty, but can result in data loss in certain situations.

By default this option is disabled, which means Unity always saves a backup of the open scenes to disk when entering play mode, regardless of the scene's "dirty" value.

Unity does this as a safety measure because there are some situations where the scene can be modified without the dirty flag being set, for example if you use an editor script to create a GameObject or Component without calling EditorSceneManager.MarkSceneDirty.

If you enable this option, when entering play mode, Unity only saves backups of open scenes with the dirty flag set. This can make it faster to enter play mode, but you should only enable it if you are sure you are not using Editor scripts or custom tools which modify the scene without calling EditorSceneManager.MarkSceneDirty, otherwise those modifications will be lost.

For more information about the options available for entering play mode, see the Configurable Enter Play Mode page in the User Manual.