Like the title implies… I have no other means to mark an object dirty then clear it afterwards… I mean I suppose I could just track with boolean variable somewhere but if the functionality is there it’d be nice…
Any chance for a EditorUtility.ClearDirty() ?
(Or EditorUtility.SetDirty(obj, false); )
Dirty is there to tell the Unity engine that it needs to clean it up, and it will mark it as no longer dirty once it has done so.
If you need to track data for your own purposes, then put it in your own data structures. Generally any variables that already exist are going to be already used for something.
Maybe use a HashSet of objects that are currently “dirty” for you?
Dirty means it has changes since last save. It becomes not dirty when you save. No real dirt and cleanup involved.
CleanDirty() = save your work. Roll your own solution to track changes, leave the dirty flag to tell Unity if something has changed since last save otherwise you (or anyone who is using your system) sooner or later will lose their work.
Makes sense. I was just lazy, took me a few minutes to do my own isModified system for the ScriptedImporter / ScriptedImporterEditor.
Thanks guys.
Edit: Also thank you for the clarification of the dirty flag. It is for saving… Thought it was for apply / revert in asset, but a bit of extra looking I became aware that this was not the case.