This commit is contained in:
geondo55
2025-05-29 16:52:57 +09:00
parent 4d4e8927ee
commit c401754e28
2 changed files with 971 additions and 1034 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -46,14 +46,8 @@ namespace Studio.HierarchyTree
public int SetItemData(HierarchyItem item) public int SetItemData(HierarchyItem item)
{ {
currentItem = item; currentItem = item;
nameText.text = item.name;
SetName();
CustomAssetRenderObject connectObj = item.linkedObject.GetComponent<CustomAssetRenderObject>();
if (connectObj != null && string.IsNullOrEmpty(connectObj.code))
{
nameText.text += $" ({connectObj.code})";
}
currentItem.isExpanded = item.isExpanded; currentItem.isExpanded = item.isExpanded;
item.onLoadProgress.RemoveAllListeners(); item.onLoadProgress.RemoveAllListeners();
item.onLoadProgress.AddListener(OnLoadProgress); item.onLoadProgress.AddListener(OnLoadProgress);
@@ -83,6 +77,7 @@ namespace Studio.HierarchyTree
public void SetSelected(bool selected) public void SetSelected(bool selected)
{ {
isSelected = selected; isSelected = selected;
SetName();
if (isSelected) if (isSelected)
{ {
backgroundImage.color = selectedColor; backgroundImage.color = selectedColor;
@@ -90,11 +85,21 @@ namespace Studio.HierarchyTree
else else
{ {
backgroundImage.color = Color.clear; backgroundImage.color = Color.clear;
}
}
private void SetName()
{
nameText.text = currentItem.name;
CustomAssetRenderObject connectObj = currentItem.linkedObject.GetComponent<CustomAssetRenderObject>();
if (connectObj != null && !string.IsNullOrEmpty(connectObj.code))
{
nameText.text += $" ({connectObj.code})";
} }
} }
public void SetSelected(List<HierarchyItem> selectedItems) public void SetSelected(List<HierarchyItem> selectedItems)
{ {
isSelected = selectedItems.Contains(currentItem); isSelected = selectedItems.Contains(currentItem);
SetName();
if (isSelected) if (isSelected)
{ {
backgroundImage.color = selectedColor; backgroundImage.color = selectedColor;