Hi,
OnGUI runs a lot and I think it is inefficient to create all of our GUI elements within it such as OnGUINode. Is there a better place we could do this, such as OnSelectionChange or some such so that it only does all the processing at the start and then only when there is an actual change. My main issue is having this foreach loop in there:
foreach (DialogueNode childNode in selectedDialogue.GetAllChildren(node))
{
EditorGUILayout.LabelField(childNode.text);
}
As we are running this every GUI interaction even when there is no change, we should really only do this once at the start and again when we know there is a change.