Add OnPasted to Visject Surface nodes for custom post-paste logic
This commit is contained in:
@@ -395,6 +395,14 @@ namespace FlaxEditor.Surface
|
||||
/// </summary>
|
||||
public virtual SurfaceNode[] SealedNodes => null;
|
||||
|
||||
/// <summary>
|
||||
/// Called after adding the control to the surface after paste.
|
||||
/// </summary>
|
||||
/// <param name="idsMapping">The nodes IDs mapping (original node ID to pasted node ID). Can be sued to update internal node's data after paste operation from the original data.</param>
|
||||
public virtual void OnPasted(System.Collections.Generic.Dictionary<uint, uint> idsMapping)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this node uses dependent boxes.
|
||||
/// </summary>
|
||||
|
||||
@@ -419,6 +419,10 @@ namespace FlaxEditor.Surface
|
||||
{
|
||||
node.Value.OnSpawned(SurfaceNodeActions.Paste);
|
||||
}
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
node.Value.OnPasted(idsMapping);
|
||||
}
|
||||
|
||||
// Add undo action
|
||||
if (Undo != null && nodes.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user