having an error pop up and when i add a new node it creates 2?
private void OnGUI()
{
if (selectedDialogue == null)
{
EditorGUILayout.LabelField("Hello World");
}
else
{
ProcessEvents();
foreach (DialogueNode node in selectedDialogue.GetAllNodes())
{
DrawNode(node);
}
foreach (DialogueNode node in selectedDialogue.GetAllNodes())
{
DrawConnections(node);
}
if (createingNode != null)
{
Undo.RecordObject(selectedDialogue, "Added Dialogue Node");
selectedDialogue.CreateNode(createingNode);
createingNode = null;
}
}
}