Fix custom actor options for prefab window

This commit is contained in:
Wojtek Figat
2021-10-25 23:23:07 +02:00
parent b9e29520cf
commit 07a6e50d14
3 changed files with 20 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ namespace FlaxEditor.Windows
b = contextMenu.AddButton("Duplicate", Editor.SceneEditing.Duplicate);
b.Enabled = hasSthSelected;
if (Editor.SceneEditing.SelectionCount == 1)
if (isSingleActorSelected)
{
var convertMenu = contextMenu.AddChildMenu("Convert");
var convertActorCm = convertMenu.ContextMenu;
@@ -100,7 +100,7 @@ namespace FlaxEditor.Windows
b = contextMenu.AddButton("Create Prefab", Editor.Prefabs.CreatePrefab);
b.Enabled = isSingleActorSelected &&
(Editor.SceneEditing.Selection[0] as ActorNode).CanCreatePrefab &&
((ActorNode)Editor.SceneEditing.Selection[0]).CanCreatePrefab &&
Editor.Windows.ContentWin.CurrentViewFolder.CanHaveAssets;
bool hasPrefabLink = canEditScene && isSingleActorSelected && (Editor.SceneEditing.Selection[0] as ActorNode).HasPrefabLink;