public int DuplicateNode(int node_id_to_duplicate) { Node node_to_duplicate = GetNodeFromID(node_id_to_duplicate); Node duplicate = new Node(); duplicate.isConditionalNode = node_to_duplicate.isConditionalNode; duplicate.m_id = duplicate.GetHashCode(); duplicate.m_position = node_to_duplicate.m_position + new Vector2(20, 20); duplicate.m_inputPlug = new Plug(); duplicate.m_inputPlug.m_nodeId = duplicate.m_id; duplicate.m_inputPlug.m_plugId = duplicate.m_inputPlug.GetHashCode(); m_nodes.Add(duplicate.m_id, duplicate); //dialogue data DialogueData dialogue = GetDataFromNodeID(node_to_duplicate.m_id); DialogueData dataCopy = dialogue.Copy(); dataCopy.node_id = duplicate.m_id; m_dialogueData.Add(duplicate.m_id, dataCopy); duplicate.m_outputPlugs = new Dictionary <int, Plug>(); for (int i = 0; i < node_to_duplicate.m_outputPlugs.Count; ++i) { AddOutputPlugToNode(duplicate.m_id); } return(duplicate.m_id); }