I have a big class (object has large arrays serialized), and default inspector is totally unusable, super slow and unresponsive.
I’ve done a custom inspector to work on this object with responsiveness, and it worked fine. But now, object has even larger arrays, and custom inspector is getting also super slow.
I’ve tried with just this OnInspectorGUI:
public override void OnInspectorGUI()
{
GUILayout.Space(1000);
GUILayout.Label("______________");
}
and it’s still suuuper slow on scrolling.
Deep profile says the culprit is
serializedobject.Update()
, which is executing in background while the object is selected, even when it’s not necessary.
So, is there any way to optimize this custom inspector by saying it not to update unless necessary? I don’t want serializedobject.Update() to be executing twice per frame and wasting more than half second if I won’t be modifying the object.
Thanks for your time!