文档

Unity Engine

Unity Engine

MarkSceneDirty()

Explicitly mark the current opened Scene as modified.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
警告
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.