Is there a way to know a ScriptableObject is dirty ?

Hi,

I only know that we can call

EditorUtility.SetDirty( foobar );

Which will make the ScriptableObject foobar dirty. But is there a way to get if the foobar is already dirty. I would like to show dirty icon for this asset in editor so that people can see it.

I don’t know how often Unity “cleans” a dirty object, but I imagine it to be after every fraction of a second. I’m actually under the assumption that Unity reacts immediately upon the call, resetting the flag as soon as it’s finished. I highly doubt that the human eye can perceive anything happening between the time that you set something dirty and the time that the dirty flag is reset.

Anyway, an object can only be “dirty” if you’ve marked it dirty. So just set a boolean to true immediately after SetDirty and use that as a marker to check if something is dirty. Of course, that boolean will continue to be true until you set it to false, and determining when to set it back to false requires knowing when the dirty flag is reset by Unity. It’s a catch 22 after all is said and done.

Thanks for the help. I think I can only do it in your way.