diff --git a/Source/Editor/SceneGraph/SceneGraphFactory.cs b/Source/Editor/SceneGraph/SceneGraphFactory.cs index 62c8f7986..4789af57e 100644 --- a/Source/Editor/SceneGraph/SceneGraphFactory.cs +++ b/Source/Editor/SceneGraph/SceneGraphFactory.cs @@ -44,6 +44,7 @@ namespace FlaxEditor.SceneGraph CustomNodesTypes.Add(typeof(SkyLight), typeof(SkyLightNode)); CustomNodesTypes.Add(typeof(PostFxVolume), typeof(PostFxVolumeNode)); CustomNodesTypes.Add(typeof(StaticModel), typeof(StaticModelNode)); + CustomNodesTypes.Add(typeof(AnimatedModel), typeof(AnimatedModelNode)); CustomNodesTypes.Add(typeof(BoxBrush), typeof(BoxBrushNode)); CustomNodesTypes.Add(typeof(TextRender), typeof(TextRenderNode)); CustomNodesTypes.Add(typeof(AudioListener), typeof(AudioListenerNode)); diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs index 51e907c27..ccc7abdb9 100644 --- a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs +++ b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs @@ -143,7 +143,23 @@ namespace FlaxEditor.Windows.Assets } // Custom options - + bool showCustomNodeOptions = Editor.SceneEditing.Selection.Count == 1; + if (!showCustomNodeOptions && Editor.SceneEditing.Selection.Count != 0) + { + showCustomNodeOptions = true; + for (int i = 1; i < Editor.SceneEditing.Selection.Count; i++) + { + if (Editor.SceneEditing.Selection[0].GetType() != Editor.SceneEditing.Selection[i].GetType()) + { + showCustomNodeOptions = false; + break; + } + } + } + if (showCustomNodeOptions) + { + Editor.SceneEditing.Selection[0].OnContextMenu(contextMenu); + } ContextMenuShow?.Invoke(contextMenu); return contextMenu; diff --git a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs index fe88a13a1..af5a007f1 100644 --- a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs +++ b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs @@ -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;