Fix creating prefabs directly from prefab objects

#1432
This commit is contained in:
Wojtek Figat
2023-10-06 10:07:57 +02:00
parent 3a56e39306
commit 9870d162e4
5 changed files with 56 additions and 29 deletions

View File

@@ -233,7 +233,7 @@ namespace FlaxEditor.Windows.Assets
contextMenu.AddSeparator();
b = contextMenu.AddButton("Create Prefab", () => Editor.Prefabs.CreatePrefab(Selection));
b = contextMenu.AddButton("Create Prefab", () => Editor.Prefabs.CreatePrefab(Selection, this));
b.Enabled = isSingleActorSelected &&
(Selection[0] as ActorNode).CanCreatePrefab &&
Editor.Windows.ContentWin.CurrentViewFolder.CanHaveAssets;

View File

@@ -53,6 +53,11 @@ namespace FlaxEditor.Windows.Assets
/// </summary>
public PrefabWindowViewport Viewport => _viewport;
/// <summary>
/// Gets the prefab objects properties editor.
/// </summary>
public CustomEditorPresenter Presenter => _propertiesEditor;
/// <summary>
/// Gets the undo system used by this window for changes tracking.
/// </summary>