将可配置参数开放到界面上。

This commit is contained in:
2026-08-04 08:58:06 +08:00
parent 1b9778abe6
commit e04b717390
8 changed files with 96 additions and 32 deletions
@@ -669,8 +669,7 @@ namespace XericUI.XTable.Rendering.Component
m_QuadtreeDirty = true;
m_StyleNamespaceDirty = true;
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_PrefabPool = new PrefabPrototypePool(ContentTransform);
CreatePools();
m_ActivePrefabMap = new Dictionary<(int, int), GameObject>();
UpdateResolvedCellSizes();
RecalculateTotalSize();
@@ -730,8 +729,7 @@ namespace XericUI.XTable.Rendering.Component
m_QuadtreeDirty = true;
m_StyleNamespaceDirty = true;
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_PrefabPool = new PrefabPrototypePool(ContentTransform);
CreatePools();
m_ActivePrefabMap = new Dictionary<(int, int), GameObject>();
UpdateResolvedCellSizes();
RecalculateTotalSize();
@@ -818,8 +816,7 @@ namespace XericUI.XTable.Rendering.Component
m_StyleNamespaceDirty = true;
ClearSelection();
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_PrefabPool = new PrefabPrototypePool(ContentTransform);
CreatePools();
m_ActivePrefabMap = new Dictionary<(int, int), GameObject>();
MarkDirty(TableDirtyType.All);
UpdateResolvedCellSizes();
@@ -261,7 +261,8 @@ namespace XericUI.XTable.Rendering.Component
if (m_Assembler == null)
{
if (rectTransform != null)
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace,
Config.TextPoolMaxCapacity, Config.ImagePoolMaxCapacity);
else return;
}
@@ -322,7 +323,8 @@ namespace XericUI.XTable.Rendering.Component
if (m_Assembler == null)
{
if (rectTransform != null)
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace,
Config.TextPoolMaxCapacity, Config.ImagePoolMaxCapacity);
else return;
}
@@ -217,6 +217,14 @@ namespace XericUI.XTable.Rendering.Component
/// <summary>单元格内容水平内边距(单侧)</summary>
private float CellPadding => Config.CellHorizontalPadding;
private void CreatePools()
{
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace,
Config.TextPoolMaxCapacity, Config.ImagePoolMaxCapacity);
m_PrefabPool = new PrefabPrototypePool(ContentTransform, Config.PrefabPoolMaxCapacity);
}
/// <summary>单元格内容宽度扣除量</summary>
private float CellPadding2 => Config.CellHorizontalPadding * 2f;
@@ -281,8 +289,7 @@ namespace XericUI.XTable.Rendering.Component
}
}
m_Assembler = new CellAssembler(ContentTransform, m_DefaultStyleNamespace);
m_PrefabPool = new PrefabPrototypePool(ContentTransform);
CreatePools();
m_ActivePrefabMap = new Dictionary<(int, int), GameObject>();
UpdateResolvedCellSizes();
RecalculateTotalSize();