Fix prefab window performance with large hierarchies
This commit is contained in:
@@ -428,11 +428,9 @@ namespace FlaxEditor.Windows.Assets
|
||||
|
||||
private void Update(ActorNode actorNode)
|
||||
{
|
||||
if (actorNode.Actor)
|
||||
{
|
||||
actorNode.TreeNode.UpdateText();
|
||||
actorNode.TreeNode.OnOrderInParentChanged();
|
||||
}
|
||||
actorNode.TreeNode.UpdateText();
|
||||
if (actorNode.TreeNode.IsCollapsed)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < actorNode.ChildNodes.Count; i++)
|
||||
{
|
||||
|
||||
@@ -440,6 +440,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
try
|
||||
{
|
||||
FlaxEngine.Profiler.BeginEvent("PrefabWindow.Update");
|
||||
if (Graph.Main != null)
|
||||
{
|
||||
// Due to fact that actors in prefab editor are only created but not added to gameplay
|
||||
@@ -468,6 +469,10 @@ namespace FlaxEditor.Windows.Assets
|
||||
Graph.Root.TreeNode.ExpandAll(true);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
FlaxEngine.Profiler.EndEvent();
|
||||
}
|
||||
|
||||
// Auto fit
|
||||
if (_focusCamera && _viewport.Task.FrameCount > 1)
|
||||
|
||||
Reference in New Issue
Block a user