mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-16 00:07:52 +08:00
attempt at auto-increasing pool size, not quite working properly
This commit is contained in:
@ -86,8 +86,8 @@ namespace UnityExplorer.UI.Panels
|
||||
var test = new DynamicListTest(scrollPool, this);
|
||||
test.Init();
|
||||
|
||||
var prototype = DynamicCell.CreatePrototypeCell(scrollContent);
|
||||
scrollPool.PrototypeCell = prototype.GetComponent<RectTransform>();
|
||||
//var prototype = DynamicCell.CreatePrototypeCell(scrollContent);
|
||||
//scrollPool.PrototypeCell = prototype.GetComponent<RectTransform>();
|
||||
|
||||
dummyContentHolder = new GameObject("DummyHolder");
|
||||
dummyContentHolder.SetActive(false);
|
||||
@ -170,9 +170,10 @@ namespace UnityExplorer.UI.Panels
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var prototype = DynamicCell.CreatePrototypeCell(Scroller.UIRoot);
|
||||
|
||||
Scroller.DataSource = this;
|
||||
Scroller.Initialize(this);
|
||||
Scroller.Initialize(this, prototype);
|
||||
}
|
||||
|
||||
public ICell CreateCell(RectTransform cellTransform) => new DynamicCell(cellTransform.gameObject);
|
||||
|
@ -223,6 +223,8 @@ namespace UnityExplorer.UI.Panels
|
||||
refreshRow.SetActive(false);
|
||||
|
||||
// Transform Tree
|
||||
|
||||
//var prototype = TransformCell.CreatePrototypeCell(scrollContent);
|
||||
|
||||
var infiniteScroll = UIFactory.CreateScrollPool(content, "TransformTree", out GameObject scrollObj,
|
||||
out GameObject scrollContent, new Color(0.15f, 0.15f, 0.15f));
|
||||
@ -230,13 +232,10 @@ namespace UnityExplorer.UI.Panels
|
||||
UIFactory.SetLayoutElement(scrollContent, flexibleHeight: 9999);
|
||||
|
||||
// Prototype tree cell
|
||||
var prototype = TransformCell.CreatePrototypeCell(scrollContent);
|
||||
infiniteScroll.PrototypeCell = prototype.GetComponent<RectTransform>();
|
||||
|
||||
//infiniteScroll.PrototypeCell = prototype.GetComponent<RectTransform>();
|
||||
|
||||
Tree = new TransformTree(infiniteScroll)
|
||||
{
|
||||
GetRootEntriesMethod = GetRootEntries
|
||||
};
|
||||
Tree = new TransformTree(infiniteScroll) { GetRootEntriesMethod = GetRootEntries };
|
||||
Tree.Init();
|
||||
|
||||
// some references
|
||||
|
Reference in New Issue
Block a user