Fix some prefabs issues
This commit is contained in:
@@ -69,6 +69,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
bool hasSthSelected = Selection.Count > 0;
|
||||
bool isSingleActorSelected = Selection.Count == 1 && Selection[0] is ActorNode;
|
||||
bool isRootSelected = isSingleActorSelected && Selection[0] == Graph.Main;
|
||||
bool hasPrefabLink = isSingleActorSelected && (Selection[0] as ActorNode).HasPrefabLink;
|
||||
|
||||
// Create popup
|
||||
|
||||
@@ -97,7 +98,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
b.Enabled = hasSthSelected && !isRootSelected;
|
||||
|
||||
b = contextMenu.AddButton("Set Root", SetRoot);
|
||||
b.Enabled = isSingleActorSelected && !isRootSelected;
|
||||
b.Enabled = isSingleActorSelected && !isRootSelected && hasPrefabLink;
|
||||
|
||||
// Prefab options
|
||||
|
||||
@@ -108,8 +109,6 @@ namespace FlaxEditor.Windows.Assets
|
||||
(Selection[0] as ActorNode).CanCreatePrefab &&
|
||||
Editor.Windows.ContentWin.CurrentViewFolder.CanHaveAssets;
|
||||
|
||||
bool hasPrefabLink = isSingleActorSelected && (Selection[0] as ActorNode).HasPrefabLink;
|
||||
|
||||
b = contextMenu.AddButton("Select Prefab", Editor.Prefabs.SelectPrefab);
|
||||
b.Enabled = hasPrefabLink;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user