public static void CreateNode(BossEditorMouseInput.NodeTypes nodeType) { if (OnCreateNode != null) { OnCreateNode(nodeType); } }
private void CreateNode(NodeTypes nodeType) { BaseNode newNode = null; switch (nodeType) { case NodeTypes.Start: newNode = ScriptableObject.CreateInstance <StartNode>(); break; case NodeTypes.End: newNode = ScriptableObject.CreateInstance <EndNode>(); break; case NodeTypes.SaySomething: newNode = ScriptableObject.CreateInstance <SpeechNode>(); break; case NodeTypes.Jump: newNode = ScriptableObject.CreateInstance <BaseNode>(); break; case NodeTypes.Die: newNode = ScriptableObject.CreateInstance <BaseNode>(); break; } if (newNode != null) { _editor.AddNode(newNode); } }