Add removing old proxy to add new one.
This commit is contained in:
@@ -735,8 +735,9 @@ namespace FlaxEditor.Modules
|
||||
/// <param name="rebuild">Should rebuild entire database after addition.</param>
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user