Page 1 of 1

Conversation node graph

Posted: Sun Nov 30, 2014 11:43 pm
by magalter
Probably this is more off topic but I'm really curious how you made the the node graph in the editor window for conversations. It is the same node graph that unity's mechanim animator controller uses, but I couldn't find any clue how to create such node graphs with the unity editor scripting API.

Conversation node graph

Posted: Mon Dec 01, 2014 1:58 am
by Tony Li
Hi,



The Dialogue System provides complete C# source code. Feel free to unpack Scripts/Source Code.unitypackage to browse through the editor code. You'll probably want to unpack it in a new project so the source scripts won't conflict with DLLs. The runtime code (the code that ships with your game projects) is cleanly and efficiently designed, but the Dialogue Editor code, while solid, isn't as nicely compartmentalized. It's implemented in one mammoth class spread across several files.



I started with the base code provided by unimechanic (a UT employee) on the Unity forums, and added code as necessary to make it look like the Mecanim canvas.



You can find the relevant files in Scripts/Core/Editor/Dialogue Editor/Conversation Node Editor/:



DialogueEditorWindowConversationNodeEditorBase.cs: Contains generic functionality that should apply to any Mecanim-style node editor.

DialogueEditorWindowConversationNodeEditor.cs: Contains most of the functionality of the node editor as it applies to the Dialogue Editor.


Conversation node graph

Posted: Mon Dec 01, 2014 2:44 am
by magalter
Ah, ok thank you very much :D