- Home /
What exactly does UpdateIfDirtyOrScript() do?
Update serialized object's representation, only if the object has been modified since the last call to Update or if it is a script. In which case it is not safe to assume that SetDirty has been called.
So, it updates data from a serialized object. OK. But
What is "modified" exactly? SetDirty was called? How does it determine that the object was modified? If I change a public variable on this object will it detect this change?
What is a "script" here? The object is a MonoScript?
Why it's not safe to assume that SetDirty was called? Because the object was changed not from an editor script?
What is Update method doing in this case? Does it do any checks at all or just dumps all fields all over again and again?
I wonder why these parts of docs barely have 2 lines of ambiguous text.
It'll be cool if this gets an answer! Not necessarily all the points the OP is asking about, but at least shed some more light on the subject!
Your answer
![](https://koobas.hobune.stream/wayback/20220613131715im_/https://answers.unity.com/themes/thub/images/avi.jpg)