重构
- 统一 ItemDescForm/RewardItem/GoodsItem 的描述格式 - 减少组件属性的 Clone 数量,目前只在合并仓库、组装防御塔时才进行复制 - 删除先前留下的冗余 fallback 代码
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user