I have this large ScriptableObject (+150MB) storing various data related to in-game characters.
When selected, the Unity Editor slows down considerably, my first idea was to make a custom inspector because the default is probably slow with all of the collection data inside.
But even with this empty custom inspector, the same slowdown occurs when the large ScriptableObject is selected in the editor.
[CustomEditor(typeof(NPCData))]
public class NPCDataEditor : Editor
{
CustomSampler samplerOnInspectorGUI = CustomSampler.Create("samplerOnInspectorGUI");
CustomSampler samplerOnEnable = CustomSampler.Create("samplerOnEnable");
private void OnEnable()
{
onEnableSampler.Begin();
Debug.Log("NPCDataEditor::OnEnable");
onEnableSampler.End();
}
public override void OnInspectorGUI()
{
OnInspectorGUISampler.Begin();
// base.OnInspectorGUI();
OnInspectorGUISampler.End();
}
}
To my surprise that didn’t help, Unity still struggles with the ScriptableObject’s size when selected in the editor.
So, I think I should create a separate editor window or a proxy scriptable object, which loads the data from the large ScriptableObject async and then only renders a small subset of data in it’s own lightweight custom inspector/window.
That way the large ScriptableObject will not be selected in the Editor and I still can manipulate it’s data via code.
But it doesn’t sound ideal.
Thank you,