修复运行时框选绘制覆盖层太多的问题,修复事件层太靠上导致预制体收不到事件的问题

This commit is contained in:
2026-07-29 15:46:39 +08:00
parent 71f5004484
commit c5fa82150f
6 changed files with 78 additions and 91 deletions
@@ -27,6 +27,7 @@ namespace XericUI.XTable.Rendering.Component
public Dictionary<(int, int), GameObject> ActivePrefabMap;
public float CellPadding;
public XTableConfig Config;
public XericUIActionTable SelectionTable;
public int StartRow;
public int StartCol;
@@ -62,12 +63,13 @@ namespace XericUI.XTable.Rendering.Component
{
if (m_BackgroundGo == null)
{
m_BackgroundGo = new GameObject("_TableBackground", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image));
m_BackgroundGo = new GameObject("_TableBackground", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(XTableSelectionInput));
m_BackgroundGo.hideFlags = HideFlags.DontSave | HideFlags.HideInHierarchy;
m_BackgroundGo.transform.SetParent(m_Parent, false);
m_BackgroundGo.transform.SetAsFirstSibling();
var image = m_BackgroundGo.GetComponent<Image>();
image.raycastTarget = false;
image.raycastTarget = true;
m_BackgroundGo.GetComponent<XTableSelectionInput>().Configure(SelectionTable);
image.color = GetStyleColor?.Invoke(styleNamespace, XericUIActionTable.STYLE_CELL_BG_COLOR,
XericUIActionTable.BG_COLOR_FALLBACK) ?? XericUIActionTable.BG_COLOR_FALLBACK;
}