| Main/System/HeroUI/HeroTrainWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Store/BuyItemWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Main/System/HeroUI/HeroTrainWin.cs
@@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; using Cysharp.Threading.Tasks; using UnityEngine; using UnityEngine.UI; @@ -196,6 +197,7 @@ Display(); } protected override void OnPreClose() { PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent; @@ -253,8 +255,31 @@ RefreshRedImg(); HeroUIManager.Instance.RemoveNewHero(hero.heroId); ForceRefreshLayout(); } /// <summary> /// 强制刷新Layout,解决嵌套Layout和ContentSizeFitter的重叠问题 /// </summary> async UniTask ForceRefreshLayout() { await UniTask.DelayFrame(2); // 刷新所有Layout组件 var layouts = allAttrScroll.GetComponentsInChildren<LayoutGroup>(true); foreach (var layout in layouts) { LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); } await UniTask.DelayFrame(2); // 刷新所有Layout组件 foreach (var layout in layouts) { LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); } } void RefreshItemLockEvent(PackType type, string guid, bool lockState) { if (type != PackType.Hero) Main/System/Store/BuyItemWin.cs
@@ -37,10 +37,10 @@ var shopConfig = StoreConfig.Get(StoreModel.Instance.buyShopID); var itemID = shopConfig.ItemID; var itemCount = shopConfig.ItemCnt; itemCell.Init(new ItemCellModel(itemID, false, itemCount)); itemCell.Init(new ItemCellModel(itemID, false, itemCount*useCnt)); var itemConfig = ItemConfig.Get(itemID); nameText.text = itemConfig.ItemName; countText.text = Language.Get("storename12", PackManager.Instance.GetItemCountByID(PackType.Item, itemID)); countText.text = Language.Get("storename12", GetItemCount(itemID)); descText.text = itemConfig.Description; var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(StoreModel.Instance.buyShopID); @@ -59,7 +59,7 @@ { var shopConfig = StoreConfig.Get(StoreModel.Instance.buyShopID); useCnt = value; itemCell.countText.text = value.ToString(); itemCell.countText.text = UIHelper.ReplaceLargeNum(value*shopConfig.ItemCnt); string limitStr = ""; if (shopConfig.LimitCnt == 0) @@ -93,4 +93,16 @@ CloseWindow(); StoreModel.Instance.SendBuyShopItem(StoreConfig.Get(StoreModel.Instance.buyShopID), useCnt); } //如果物品是自动转换货币类型的,则返回货币数量,否则返回物品数量 long GetItemCount(int id) { var config = ItemConfig.Get(id); if (config.Effect1 == 264) { return UIHelper.GetMoneyCnt(config.EffectValueB1); } return PackManager.Instance.GetItemCountByID(PackType.Item, id); } }