Fix duplicating spline

#452
This commit is contained in:
Wojtek Figat
2021-04-12 21:06:34 +02:00
parent 3bfeb1db76
commit 55155630ca
5 changed files with 25 additions and 3 deletions

View File

@@ -22,14 +22,25 @@ namespace FlaxEditor.Modules
/// <seealso cref="FlaxEditor.SceneGraph.RootNode" />
public class ScenesRootNode : RootNode
{
private readonly Editor _editor;
/// <inheritdoc />
public ScenesRootNode()
{
_editor = Editor.Instance;
}
/// <inheritdoc />
public override void Spawn(Actor actor, Actor parent)
{
Editor.Instance.SceneEditing.Spawn(actor, parent);
_editor.SceneEditing.Spawn(actor, parent);
}
/// <inheritdoc />
public override Undo Undo => Editor.Instance.Undo;
/// <inheritdoc />
public override List<SceneGraphNode> Selection => _editor.SceneEditing.Selection;
}
/// <summary>

View File

@@ -29,7 +29,7 @@ namespace FlaxEditor.SceneGraph.Actors
public override bool CanBeSelectedDirectly => true;
public override bool CanDuplicate => true;
public override bool CanDuplicate => !Root?.Selection.Contains(ParentNode) ?? true;
public override bool CanDelete => true;

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEditor.SceneGraph.Actors;
using FlaxEngine;
@@ -146,5 +147,10 @@ namespace FlaxEditor.SceneGraph
/// Gets the undo.
/// </summary>
public abstract Undo Undo { get; }
/// <summary>
/// Gets the list of selected scene graph nodes in the editor context.
/// </summary>
public abstract List<SceneGraphNode> Selection { get; }
}
}

View File

@@ -57,7 +57,9 @@ namespace FlaxEditor.SceneGraph
/// </summary>
public virtual RootNode Root => ParentNode?.Root;
/// <inheritdoc />
/// <summary>
/// Gets or sets the transform of the node.
/// </summary>
public abstract Transform Transform { get; set; }
/// <summary>

View File

@@ -36,6 +36,9 @@ namespace FlaxEditor.Windows.Assets
/// <inheritdoc />
public override Undo Undo => _window.Undo;
/// <inheritdoc />
public override List<SceneGraphNode> Selection => _window.Selection;
}
/// <summary>