Fix transform tree and scroller, add update toggle and refresh button

This commit is contained in:
Sinai
2021-04-16 04:33:13 +10:00
parent 9a9048bcd8
commit c1d3aab8e3
5 changed files with 82 additions and 25 deletions

View File

@ -76,13 +76,11 @@ namespace UnityExplorer.UI.Widgets.InfiniteScroll
return;
this.ExternallySetting = true;
ExplorerCore.Log("Slider value changed");
// Jump to val * count (ie, 0.0 would jump to top, 1.0 would jump to bottom)
var index = Math.Floor(val * DataSource.ItemCount);
JumpToIndex((int)index);
this.ExternallySetting = false;
//this.ExternallySetting = false;
});
}
@ -104,6 +102,8 @@ namespace UnityExplorer.UI.Widgets.InfiniteScroll
_prevAnchoredPos = scrollRect.content.anchoredPosition;
SetSliderFromScrollValue();
// ExternallySetting = false;
}

View File

@ -45,6 +45,9 @@ namespace UnityExplorer.UI.Widgets
//This is called from the SetCell method in DataSource
public void ConfigureCell(CachedTransform cached, int cellIndex)
{
if (cached == null || !cached.Value)
return;
if (!Enabled)
Enable();
@ -62,14 +65,16 @@ namespace UnityExplorer.UI.Widgets
nameLabel.text = $"<color=grey>[{childCount}]</color> {nameLabel.text}";
expandButton.interactable = true;
expandLabel.enabled = true;
//expandLabel.enabled = true;
expandLabel.text = cached.Expanded ? "▼" : "►";
expandLabel.color = cached.Expanded ? new Color(0.5f, 0.5f, 0.5f) : new Color(0.3f, 0.3f, 0.3f);
}
else
{
expandButton.interactable = false;
expandLabel.enabled = false;
expandLabel.text = "▪";
expandLabel.color = new Color(0.3f, 0.3f, 0.3f);
//expandLabel.enabled = false;
}
}