- Home /
Determine if editor is in dirty state (current scene needs to be saved)
Hello,
I couldn't find any info about this...
I'm building an editor window who can change scene when you click on a button. I'd like to know if the current scene is dirty (something changed and needs to be saved) or not, prior to opening the new one. Is there any way to do it?
Thanks
Answer by Demigiant · Feb 08, 2012 at 05:53 PM
Found a sort of solution. Calling `EditorApplication.SaveCurrentSceneIfUserWantsTo()` will open a save popup only if the current scene is dirty.
Answer by beeftime · Aug 10, 2015 at 03:02 AM
This is old, but it still hits on Google searches so I thought I should answer it.
This can now be checked via EditorApplication.isSceneDirty
Answer by jethrogillgren · Sep 11, 2018 at 11:38 AM
Since Unity 2017.3, the answer is SceneManager.GetActiveScene().isDirty
Your answer
Follow this Question
Related Questions
black screen in build but in the editor work fine 0 Answers
How to select a position for displaying Holograms? 1 Answer
Scene overlapping on real device 1 Answer
【LuminSDK Unity】Deploy to Magic Leap One and MLDB error: API level requested does not support 1 Answer
How to correctly save a screenshot in a custom path? 1 Answer