mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 06:08:16 +08:00
Refresh for child count or name changes in TransformTree
This commit is contained in:
parent
3d94b51d40
commit
57aace26d3
@ -14,6 +14,8 @@ namespace UnityExplorer.UI.Widgets
|
||||
public CachedTransform Parent { get; internal set; }
|
||||
|
||||
public int Depth { get; internal set; }
|
||||
public int ChildCount { get; internal set; }
|
||||
public string Name { get; internal set; }
|
||||
|
||||
public bool Expanded => Tree.IsCellExpanded(InstanceID);
|
||||
|
||||
@ -26,10 +28,19 @@ namespace UnityExplorer.UI.Widgets
|
||||
Update(transform, depth);
|
||||
}
|
||||
|
||||
public void Update(Transform transform, int depth)
|
||||
public bool Update(Transform transform, int depth)
|
||||
{
|
||||
Value = transform;
|
||||
Depth = depth;
|
||||
bool ret = false;
|
||||
|
||||
if (Value != transform || depth != Depth || ChildCount != transform.childCount || Name != transform.name)
|
||||
{
|
||||
Value = transform;
|
||||
Depth = depth;
|
||||
ChildCount = transform.childCount;
|
||||
Name = transform.name;
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,8 @@ namespace UnityExplorer.UI.Widgets
|
||||
if (displayedObjects.Contains(instanceID))
|
||||
{
|
||||
cached = (CachedTransform)displayedObjects[(object)instanceID];
|
||||
cached.Update(transform, depth);
|
||||
if (cached.Update(transform, depth))
|
||||
needRefresh = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user