public sealed class PasteCommandDropping a copied fragment into a graph.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The pasted nodes get fresh identities and the fragment's edges are rewritten to match. Pasting into the graph the fragment came from is the ordinary case, and reusing the identities there would collide with the originals.
⚠ The identities are minted once and reused on every redo. A paste that renumbered each time would leave an undone-and-redone paste holding different nodes from the ones the author then selected and moved, so the next undo would move the wrong things back.
Fields and properties (2)
public override string NameWhat this is called in the undo history, as a person would say it.
public IReadOnlyList<GraphNode> PastedWhat was pasted, once it has been.
Methods (3)
public PasteCommand(NodeGraphModel graph, NodeGraphAsset fragment, Vector2 offset = default(Vector2), EditorDocument? document = null)Describes pasting a fragment.
protected override void Apply()Makes the change. Called once on execute and again on every redo.
protected override void Revert()Puts back exactly what Apply changed.
Used by (2)
- CommandTestsVixen.Editor.NodeGraph.Tests
- NodeGraphViewVixen.Editor.NodeGraph