Add main content nodes to not be duplicated.
This commit is contained in:
@@ -28,6 +28,11 @@ namespace FlaxEditor.Content
|
||||
/// Whether this node can be deleted.
|
||||
/// </summary>
|
||||
protected virtual bool _canDelete => true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this node can be duplicated.
|
||||
/// </summary>
|
||||
protected virtual bool _canDuplicate => true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content folder item.
|
||||
@@ -315,7 +320,7 @@ namespace FlaxEditor.Content
|
||||
switch (key)
|
||||
{
|
||||
case KeyboardKeys.D:
|
||||
if (Folder.Exists)
|
||||
if (Folder.Exists && _canDuplicate)
|
||||
Editor.Instance.Windows.ContentWin.Duplicate(Folder);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ namespace FlaxEditor.Content
|
||||
/// <inheritdoc />
|
||||
protected override bool _canDelete => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool _canDuplicate => false;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MainContentTreeNode"/> class.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user