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