浏览代码

购买提示文字

zhaoyang 2 年之前
父节点
当前提交
a1b4a16a78
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

@@ -124,7 +124,9 @@ namespace GFGGame
                 int maxBuyCount = (int)Math.Floor((decimal)(ItemDataManager.GetItemNum(itemExchangeCfg.costId) / itemExchangeCfg.costNumArr[0]));
                 _maxCanBuy = Math.Min(Math.Min(maxCount, maxBuyCount), itemExchangeCfg.maxLimit == 0 ? maxCount : itemExchangeCfg.maxLimit - ItemDataManager.GetItemExchangeTimes(buyId));
                 _itemId = buyId;
-
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemExchangeCfg.id);
+                ItemCfg itemCostCfg = ItemCfgArray.Instance.GetCfg(itemExchangeCfg.costId);
+                _ui.m_txtBuyTips.text = string.Format("消耗{0}{1},可兑换{2}{3}", itemExchangeCfg.costNumArr[0], itemCostCfg.name, itemExchangeCfg.num, itemCfg.name);
             }
             GetMoneyIdAndNum(minBuyCount, out _costId, out _costNum, out _buyNum);
 
@@ -151,7 +153,6 @@ namespace GFGGame
             ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(_costId);
             _ui.m_iconPrice.url = ResPathUtil.GetCommonGameResPath(costItemCfg.res);
             _ui.m_txtBuyTips.visible = false;
-            _ui.m_txtBuyTips.text = string.Format("消耗{0}{1},可兑换{2}{3}", _costNum, costItemCfg.name, _buyNum, itemCfg.name);
             UpdateCost();
         }
         private void UpdateCost()