Might somebody clarify what’s the distinction between Replace
and UpdateIfRequiredOrScript
?
The docs are actually obscure, from what I perceive, UpdateIfRequiredOrScript
is a barely optimized model of Replace
as ‘provided that’ however are there any caveats about utilizing the latter than the previous ?
SerializedObject.Replace (167 usages present in Unity assemblies):
Replace serialized object’s illustration.
SerializedObject.UpdateIfRequiredOrScript (17 usages present in Unity assemblies):
Replace serialized object’s illustration, provided that the thing has been modified because the final name to Replace or if it’s a script.
By which case it’s not protected to imagine that SetDirty has been referred to as. Return true if an Replace was performed.
So, to me, it seems that Replace
is perhaps safer to make use of than UpdateIfRequiredOrScript
on the expense of being a bit extra expensive, however that is only a supposition.