From 8b3f1ca01935387d5957ac4b403598b5503aa049 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Oct 2024 18:25:04 +0200 Subject: [PATCH 1/2] make "Edit Prefab" not change content panel file path If someone still wants to change the Content panel to the file path of the prefab, they can use the "Select Prefab" button --- Source/Editor/CustomEditors/Dedicated/ActorEditor.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index 27e2849bd..bc40c77ff 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -9,6 +9,7 @@ using FlaxEditor.CustomEditors.Elements; using FlaxEditor.GUI; using FlaxEditor.GUI.ContextMenu; using FlaxEditor.GUI.Tree; +using FlaxEditor.Modules; using FlaxEditor.Scripting; using FlaxEditor.Windows; using FlaxEditor.Windows.Assets; @@ -87,9 +88,7 @@ namespace FlaxEditor.CustomEditors.Dedicated var editPrefab = panel.Button("Edit Prefab"); editPrefab.Button.Clicked += () => { - Editor.Instance.Windows.ContentWin.ClearItemsSearch(); - Editor.Instance.Windows.ContentWin.Select(prefab); - Editor.Instance.Windows.ContentWin.Open(Editor.Instance.Windows.ContentWin.View.Selection[0]); + Editor.Instance.Windows.ContentWin.Open(Editor.Instance.ContentDatabase.FindAsset(prefab.ID)); }; // Viewing changes applied to this actor From 1fca41b31a4d84302f6a2ca3b662f084f5788616 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Oct 2024 18:29:48 +0200 Subject: [PATCH 2/2] code style fix --- Source/Editor/CustomEditors/Dedicated/ActorEditor.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index bc40c77ff..3e6785491 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -86,10 +86,7 @@ namespace FlaxEditor.CustomEditors.Dedicated // Edit selected prefab asset var editPrefab = panel.Button("Edit Prefab"); - editPrefab.Button.Clicked += () => - { - Editor.Instance.Windows.ContentWin.Open(Editor.Instance.ContentDatabase.FindAsset(prefab.ID)); - }; + editPrefab.Button.Clicked += () => Editor.Instance.Windows.ContentWin.Open(Editor.Instance.ContentDatabase.FindAsset(prefab.ID)); // Viewing changes applied to this actor var viewChanges = panel.Button("View Changes");