Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MarkSceneDirty()

Explicitly mark the current opened Scene as modified.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
Warning
Deprecated. Use EditorSceneManager.MarkSceneDirty or EditorSceneManager.MarkAllScenesDirty
public static void MarkSceneDirty()

Remarks

Normally, an operation resulting in a Scene file change should register itself with the undo system, which automatically handles Scene dirty state tracking. However, if for whatever reason you can't make the operation undoable, you can use this function to explicitly mark the Scene as modified, so that the user will be prompted to save the Scene when it's being closed.