What Is The Conceptual Difference Between EditorUtility.SetDirty() And AssetDatabase.SaveAssets()

These two seem to be about the same thing. Both are telling Unity to serialise assets to the disk. From the naming one is a bit indirect, more like schedule saving an asset by marking it dirty so when it’s time to save it will be saved. And one is more direct, a’la “do it”. But is there and what exactly is the difference of the two? Thanks a lot for clarification.

AssetDatabase.SaveAssets() will save ALL unsaved asset changes.

EditorUtility.SetDirty() can save one single object at a time…

“Dirty” is a standard operating systems concept. It’s one of those things trained coders, who have never seen Unity before, will immediately understand and know how to use.

As you note, Dirty is merely a mark for a delayed save, so is more efficient. Say you quickly change something six times. Better to mark it dirty six times with one final auto-save, then to save it six times.