浏览代码

卡牌报错

zhaoyang 2 年之前
父节点
当前提交
520d8b2d12
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

+ 8 - 4
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -339,8 +339,8 @@ namespace GFGGame
             int type = (int)sender.data;
             GObject obj = sender.parent;
 
-            UI_ComConsume listItem = UI_ComConsume.Proxy(obj);
-            int index = (int)listItem.target.data;
+            // UI_ComConsume listItem = UI_ComConsume.Proxy(obj);
+            int index = (int)obj.data;// (int)listItem.target.data;
             int itemId = upgradeCardItemsArr[index];
             _consumeSelectItem = obj;
             _consumeSelectIndex = type;
@@ -366,7 +366,9 @@ namespace GFGGame
                 if (_consumeSelectIndex == 0)
                 {
                     UI_ComConsume listItem = UI_ComConsume.Proxy(_consumeSelectItem);
-                    if (!CommonUtil.Instance.CheckPointIsOnComponent(listItem.m_btnMinus, CommonUtil.Instance.GetMouseV2Point()))
+                    bool pointIsOnComponent = CommonUtil.Instance.CheckPointIsOnComponent(listItem.m_btnMinus, CommonUtil.Instance.GetMouseV2Point());
+                    UI_ComConsume.ProxyEnd();
+                    if (!pointIsOnComponent)
                     {
                         Timers.inst.Remove(OnTimedEvent);
                         return;
@@ -405,7 +407,7 @@ namespace GFGGame
         {
             UI_ComConsume listItem = UI_ComConsume.Proxy(obj);
 
-            int index = (int)listItem.target.data;
+            int index = (int)obj.data;
             int itemId = upgradeCardItemsArr[index];
 
             if (itemsCount[index] == ItemDataManager.GetItemNum(itemId))
@@ -431,6 +433,7 @@ namespace GFGGame
             if (IsUpLvLimit(itemId, false)) return false;
             itemsCount[index] = itemsCount[index] + 1;
             listItem.m_txtUseCount.text = itemsCount[index].ToString();
+            UI_ComConsume.ProxyEnd();
             this.UpdatePreView();
             return true;
         }
@@ -449,6 +452,7 @@ namespace GFGGame
             }
             itemsCount[index] = itemsCount[index] - 1;
             listItem.m_txtUseCount.text = itemsCount[index].ToString();
+            UI_ComConsume.ProxyEnd();
             this.UpdatePreView();
         }
         private void UpdatePreView()