mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-16 00:07:52 +08:00
Improve TransformTree efficiency
- Added batching to the update method so that a maximum of 2000 GameObjects are traversed each frame. - Changed from OrderedDictionary.Remove to OrderedDictionary.RemoveAt when pruning entries as the former needs to iterate through all entries to find the index of the key, whereas the latter is constant time.
This commit is contained in:
@ -82,7 +82,7 @@ namespace UnityExplorer.Inspectors
|
||||
this.Target = newTarget;
|
||||
GOControls.UpdateGameObjectInfo(true, true);
|
||||
GOControls.UpdateTransformControlValues(true);
|
||||
TransformTree.RefreshData(true, false);
|
||||
TransformTree.RefreshData(true, false, true);
|
||||
UpdateComponents();
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ namespace UnityExplorer.Inspectors
|
||||
|
||||
GOControls.UpdateGameObjectInfo(false, false);
|
||||
|
||||
TransformTree.RefreshData(true, false);
|
||||
TransformTree.RefreshData(true, false, false);
|
||||
UpdateComponents();
|
||||
}
|
||||
}
|
||||
@ -220,7 +220,7 @@ namespace UnityExplorer.Inspectors
|
||||
var newObject = new GameObject(input);
|
||||
newObject.transform.parent = GOTarget.transform;
|
||||
|
||||
TransformTree.RefreshData(true, false);
|
||||
TransformTree.RefreshData(true, false, true);
|
||||
}
|
||||
|
||||
private void OnAddComponentClicked(string input)
|
||||
|
Reference in New Issue
Block a user