Add support for custom duplicate of SceneGraphNode

This commit is contained in:
Wojtek Figat
2021-02-01 16:03:33 +01:00
parent d69b005792
commit b22805f866
7 changed files with 103 additions and 18 deletions

View File

@@ -65,6 +65,11 @@ namespace FlaxEditor.SceneGraph
/// </summary>
public virtual bool CanCopyPaste => true;
/// <summary>
/// Gets a value indicating whether this instance can be duplicated by the user.
/// </summary>
public virtual bool CanDuplicate => true;
/// <summary>
/// Gets a value indicating whether this node can be deleted by the user.
/// </summary>
@@ -359,6 +364,17 @@ namespace FlaxEditor.SceneGraph
{
}
/// <summary>
/// Duplicates this object. Valid only if <see cref="CanDuplicate"/> returns true.
/// </summary>
/// <param name="undoAction">The undo action that duplicated the object (already performed), null if skip it.</param>
/// <returns>The duplicated object node.</returns>
public virtual SceneGraphNode Duplicate(out IUndoAction undoAction)
{
undoAction = null;
return null;
}
/// <summary>
/// Releases the node and the child tree. Disposed all GUI parts and used resources.
/// </summary>