- 统一 ItemDescForm/RewardItem/GoodsItem 的描述格式
- 减少组件属性的 Clone 数量,目前只在合并仓库、组装防御塔时才进行复制
- 删除先前留下的冗余 fallback 代码
This commit is contained in:
SepComet
2026-03-12 15:58:14 +08:00
parent 9e59865368
commit 4962b98714
20 changed files with 263 additions and 435 deletions
@@ -39,13 +39,7 @@ namespace GeometryTD.UI
[SerializeField] private float _sideGap = 16f;
[SerializeField] private float _anchorItemWidth = 0f;
[SerializeField] private Graphic _blankAreaGraphic;
[SerializeField] private bool _disableBlankAreaRaycast = true;
[SerializeField] private bool _closeOnPointerDownOutsideContent = true;
private readonly List<GameObject> _runtimeTagItems = new List<GameObject>();
private ItemDescFormContext _context;
@@ -84,12 +78,7 @@ namespace GeometryTD.UI
{
base.OnOpen(userData);
_isOpened = true;
if (_disableBlankAreaRaycast && _blankAreaGraphic != null)
{
_blankAreaGraphic.raycastTarget = false;
}
if (!(userData is ItemDescFormContext context))
{
Log.Error("ItemDescFormContext is invalid.");
@@ -119,7 +108,7 @@ namespace GeometryTD.UI
private void Update()
{
if (!_isOpened || !_closeOnPointerDownOutsideContent || _content == null)
if (!_isOpened || _content == null)
{
return;
}
@@ -95,7 +95,7 @@ namespace GeometryTD.UI
public void OnClick()
{
if (_context == null || !_context.IsSelectable)
if (_context == null)
{
return;
}