- Home /
What is the different between SerializedObject.Update and SerializedObject.UpdateIfRequiredOrScript ?
The documentation says "In which case it is not safe to assume that SetDirty has been called." for UpdateIfRequiredOrScript
. What does it mean ?
The sentence is indeed quite confusing. $$anonymous$$y guess is that the sentence is referring to the previous sentence. "It is not safe to assume that SetDirty() has been called when the object is a script. In this case Update() will be called". Either way when neglecting the sentence, the description is much clearer and gives enough information to use it. I would suggest to leave feedback at the concerned page.
And the difference between those are representing in pseudocode.
bool UpdateIfRequiredOrScript()
{
if (!ConditionsAre$$anonymous$$et())
return false;
Update();
return true;
}
Your answer

Follow this Question
Related Questions
Undo a instantiated gameObject Editor Script C# 1 Answer
Type casting SerializedProperty.objectReferenceValue doesn't work? 3 Answers
Override Transform Inspector using SerializedObject and SerializedProperty 1 Answer
Draw inspector for SerializedObject within EditorWindow? 1 Answer
PropertyDrawer and EditorWindow 1 Answer