So I’ve been working creating a dialogue editor in graph view. I would like to be able to copy paste nodes. Currently unable to do that. How would I go about implementing this?
Firstly, you need 2 basic function.
1 is, converting your nodes into string type variable.
2 is, converting a string type variable to your nodes.
Then there is 2 different callbacks that you need to register:
serializeGraphElements += CutCopyOperation;
unserializeAndPaste += PasteOperation;
serializeGraphElements is called when user copy, cut any item.
unserializeAndPase is called when user tries to paste.
Duplicating calls both so, once you made it ready you can think as duplication is ready.
If you are interested in further implementations, I’ve prepared an asset about Visualizing State Machines (Dialogue System) in Node Graph. You can take it and use it by implementing your nodes in it.
I’m also leaving link to that here:
VSM