public void CopyNodes() { StateNodeClipboard clipboard = new StateNodeClipboard(); clipboard.CopyFrom(Graph, Selecteds, -Canvas.Position); StateNodeClipboard.Clipboard.Remove(Graph.GetType()); StateNodeClipboard.Clipboard.Add(Graph.GetType(), clipboard); }
public bool Duplicate() { StateNodeClipboard clipboard = new StateNodeClipboard(); if (clipboard.CopyFrom(Graph, Selecteds, Vector2.zero)) { RegistUndo("Duplicate"); var newNodes = clipboard.PasteTo(Graph, new Vector2(50, 50)); Selecteds.Clear(); foreach (var node in newNodes) { node.SortIndex = ++SelectIndex; Selecteds.Add(node); UpdateBounds(node); } SortNodes(); return(true); } return(false); }