From e21c8848412255c6056851a1aa789f7d06d0b988 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 16 Aug 2024 13:49:50 -0500 Subject: [PATCH] Add removing old proxy to add new one. --- Source/Editor/Modules/ContentDatabaseModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index 688454542..aab5d1b39 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -735,8 +735,9 @@ namespace FlaxEditor.Modules /// Should rebuild entire database after addition. public void AddProxy(ContentProxy proxy, bool rebuild = false) { - if (Proxy.Find(x => x.GetType().ToString().Equals(proxy.GetType().ToString(), StringComparison.Ordinal)) != null) - return; + var oldProxy = Proxy.Find(x => x.GetType().ToString().Equals(proxy.GetType().ToString(), StringComparison.Ordinal)); + if (oldProxy != null) + RemoveProxy(oldProxy); Proxy.Insert(0, proxy); if (rebuild) Rebuild(true);