hch
2025-09-08 4c6112ff6aa931c75d2b51591af598d4e9f008eb
7 【武将】武将系统-测试bug记录
6个文件已修改
6个文件已添加
285 ■■■■ 已修改文件
Main/System/HeroUI/GiftBaseCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionCardCell.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionCardCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionLineCell.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionLineCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionWin.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroGiftEatWin.cs 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroGiftRoleListCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroLVBreakWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/UIHelper.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/GiftBaseCell.cs
@@ -139,7 +139,7 @@
        {
            var giftConfig = HeroTalentConfig.Get(giftID);
            SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
            Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
            Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV)));
            UIManager.Instance.OpenWindow<SmallTipWin>();
        }
Main/System/HeroUI/HeroCollectionCardCell.cs
New file
@@ -0,0 +1,87 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
public class HeroCollectionCardCell : MonoBehaviour
{
    [SerializeField] Button heroCardBtn;
    [SerializeField] Image heroCardBG;
    [SerializeField] Material glowMaterial; // 流光效果材质
    [SerializeField] Text lvText;
    [SerializeField] Image countryImg;
    [SerializeField] Image jobImg;
    [SerializeField] UIHeroController heroModel;
    [SerializeField] Image onStateImg;
    [SerializeField] RedpointBehaviour redpoint;
    [SerializeField] Image trainStateImg;
    [SerializeField] Text nameText;
    [SerializeField] Image awakeImg;
    [SerializeField] Text awakeLVText;
    [SerializeField] List<Image> starImgList;
    string guid;
    public void Display(int index)
    {
        guid = HeroUIManager.Instance.heroSortList[index];
        var hero = HeroManager.Instance.GetHero(guid);
        if (hero == null)
        {
            this.gameObject.SetActive(false);
            return;
        }
        this.gameObject.SetActive(true);
        heroCardBG.SetSprite("herocardbg" + hero.Quality);
        if (glowMaterial != null)
        {
            heroCardBG.material = glowMaterial;
        }
        lvText.text = Language.Get("L1094") + hero.heroLevel.ToString();
        var heroConfig = hero.heroConfig;
        countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
        jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
        heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
        onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
        redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
        var funcState = hero.funcState;
        if (funcState > 0)
        {
            trainStateImg.SetActive(true);
            trainStateImg.SetSprite("herofuncstate" + hero.funcState);
        }
        else
        {
            trainStateImg.SetActive(false);
        }
        nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel);
        awakeImg.SetActive(hero.awakeLevel > 0);
        awakeLVText.text = hero.awakeLevel.ToString();
        for (int i = 0; i < starImgList.Count; i++)
        {
            if (hero.heroStar == 0 && i == 0)
            {
                // 无星级 特殊处理
                starImgList[i].SetActive(true);
                starImgList[i].SetSprite("herostar" + hero.heroStar);
            }
            else if ((hero.heroStar - 1) % starImgList.Count >= i)
            {
                starImgList[i].SetActive(true);
                starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count);
            }
            else
            {
                starImgList[i].SetActive(false);
            }
        }
        heroCardBtn.AddListener(() =>
        {
            HeroUIManager.Instance.selectHeroGuid = guid;
            UIManager.Instance.OpenWindow<HeroTrainWin>();
        });
    }
}
Main/System/HeroUI/HeroCollectionCardCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 13346ce9b4f57a64a9219a266123d91f
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroCollectionLineCell.cs
New file
@@ -0,0 +1,23 @@
using UnityEngine;
public class HeroCollectionLineCell : CellView
{
    [SerializeField] HeroCardCell[] cardList;
    public void Display(int index)
    {
        for (int i = 0; i < cardList.Length; i++)
        {
            if (i + index < HeroUIManager.Instance.heroSortList.Count)
            {
                cardList[i].SetActive(true);
                cardList[i].Display(index + i);
            }
            else
            {
                cardList[i].SetActive(false);
            }
        }
    }
}
Main/System/HeroUI/HeroCollectionLineCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1e06f8c655ff0c44cbc7cfe7ea09b808
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroCollectionWin.cs
New file
@@ -0,0 +1,27 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将图鉴界面
/// </summary>
public class HeroCollectionWin : UIBase
{
    protected override void InitComponent()
    {
    }
    protected override void OnPreOpen()
    {
    }
    protected override void OnPreClose()
    {
    }
}
Main/System/HeroUI/HeroCollectionWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2cde85a874c704d438bc433ea5bbbabd
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroGiftEatWin.cs
@@ -26,15 +26,9 @@
    protected override void InitComponent()
    {
        addHeroBtn.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
        });
        addHeroBtn.AddListener(OpenSelectWin);
        addHeroGo.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
        });
        addHeroGo.AddListener(OpenSelectWin);
        eatBtn.AddListener(EatHero);
    }
@@ -94,14 +88,14 @@
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
        //洗炼和觉醒的天赋未处理不可吞噬
        if (hero.talentRandomIDList.Count > 0 )
        {
        if (hero.talentRandomIDList.Count > 0)
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift4");
            return;
        }
        if (hero.talentAwakeRandomIDList.Count > 0)
        {
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift5");
            return;
        }
@@ -109,6 +103,22 @@
        var eatHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid);
        if (hero == null || eatHero == null)
            return;
        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift7");
            return;
        }
        if (hero.IsFullStar())
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift1");
            return;
        }
        var pack = new CB231_tagCSHeroStarUP();
        pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
@@ -129,4 +139,28 @@
        };
    }
    void OpenSelectWin()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
        if (hero == null)
        {
            CloseWindow();
            return;
        }
        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift7");
            return;
        }
        if (hero.IsFullStar())
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift1");
            return;
        }
        UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
    }
}
Main/System/HeroUI/HeroGiftRoleListCell.cs
@@ -24,7 +24,7 @@
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroEatList[index]);
        //上阵 锁定 觉醒 的情况
        if (hero.awakeLevel > 0 || hero.breakLevel > 0)
        if (hero.awakeLevel > 0)
        {
            SysNotifyMgr.Instance.ShowTip("HeroReborn1");
            return;
Main/System/HeroUI/HeroLVBreakWin.cs
@@ -64,8 +64,8 @@
            hero.qualityConfig.BreakLVAddPer * (hero.breakLevel + 1));
        }
        moneyIcon.SetOrgSprite(ItemConfig.Get(nextBreakLVConfig.UPCostItem[0]).IconKey);
        moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], nextBreakLVConfig.UPCostItem[1]);
        moneyIcon.SetOrgSprite(ItemConfig.Get(hero.qualityBreakConfig.UPCostItem[0]).IconKey);
        moneyText.text = UIHelper.ShowUseItem(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], hero.qualityBreakConfig.UPCostItem[1]);
        var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1);
        if (nextQualityBreakConfig == null)
Main/System/HeroUI/HeroTrainWin.cs
@@ -164,6 +164,7 @@
        PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
        HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
        UIManager.Instance.OnCloseWindow += OnCloseWindow;
        HeroUIManager.Instance.OnTeamPosChangeEvent += TeamPosChangeEvent;
        guid = HeroUIManager.Instance.selectHeroGuid;
        hero = HeroManager.Instance.GetHero(guid);
        unfoldState = false;
@@ -177,6 +178,7 @@
        PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
        HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
        UIManager.Instance.OnCloseWindow -= OnCloseWindow;
        HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamPosChangeEvent;
    }
    private void OnCloseWindow(UIBase closeUI)
@@ -520,7 +522,6 @@
        list.Sort();
        string allAttrStr = string.Empty;
        for (int i = 0; i < list.Count; i++)
        {
            var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, i + 1);
@@ -540,7 +541,7 @@
                var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID);
                if (skill != null)
                {
                    attrStrArr.Add(skill.Description);
                    attrStrArr.Add(Language.Get("equipQualityFormat", skill.SkillName) + skill.Description);
                }
                else
                {
@@ -564,7 +565,7 @@
            {
                //置灰
                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, string.Join(Language.Get("L1112"), attrStrArr));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join(Language.Get("L1112"), attrStrArr)));
            }
        }
@@ -574,7 +575,7 @@
    void RefreshFetter()
    {
        if (hero.heroConfig.FetterIDList.Length == 0)
        {
        {
            fetterGo.SetActive(false);
            return;
        }
@@ -626,11 +627,6 @@
            starUPBtnText.text = Language.Get("HeroGift7");
            starUPBtn.SetInteractable(false);
        }
        else if (hero.IsFullStar())
        {
            starUPBtnText.text = Language.Get("HeroGift3");
            starUPBtn.SetInteractable(true);
        }
        else
        {
            starUPBtnText.text = Language.Get("HeroGift3");
@@ -659,6 +655,12 @@
    void Wash()
    {
        if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel);
            return;
        }
        HeroUIManager.Instance.selectWashHeroGUID = hero.itemHero.guid;
        UIManager.Instance.OpenWindow<HeroGiftWashWin>();
@@ -698,14 +700,15 @@
            }
            else if (type == 2)
            {
                awakeStr = SkillConfig.Get(config.SkillID).Description;
                var skill = SkillConfig.Get(config.SkillID);
                awakeStr = Language.Get("equipQualityFormat", skill.SkillName) + skill.Description;
            }
            else
            {
                for (int k = 0; k < config.AttrIDList.Length; k++)
                {
                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k]) +
                        (k == config.AttrIDList.Length - 1 ? "" : "\n");
                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k],  "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"))
                    + (k == config.AttrIDList.Length - 1 ? "" : "\n");
                }
            }
@@ -718,8 +721,13 @@
            {
                //置灰
                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096"));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, awakeStr);
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(awakeStr));
            }
        }
    }
    void TeamPosChangeEvent(List<int> posList, int flyFrom, Vector3 startPos)
    {
        fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculatePower());
    }
}
Main/Utility/UIHelper.cs
@@ -75,7 +75,7 @@
            _image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey);
        }
        else
        {
        {
            Debug.LogError("MoneyDisplayModel 为配置货币类型:" + moneyType);
        }
    }
@@ -753,7 +753,7 @@
                return StringUtility.Contact("<color=#dfbbed>", msg, "</color>");
            case TextColType.itembuxiu:
                // 5eeff2 不朽
                return  StringUtility.Contact("<color=#5eeff2>", msg, "</color>");
                return StringUtility.Contact("<color=#5eeff2>", msg, "</color>");
            case TextColType.itemyonghen:
                // f5b4ea 永恒
                return StringUtility.Contact("<color=#f5b4ea>", msg, "</color>");
@@ -762,7 +762,7 @@
    }
    public static string AppendColor(Color color, string msg)
    {
    {
        return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>");
    }
@@ -927,7 +927,7 @@
    }
    #endregion
    #region 得到金钱数量根据金钱类型
@@ -1141,7 +1141,7 @@
    #endregion
    #region 得到装备位或者祝福树品质名称 带颜色
    public static string GetQualityNameWithColor(int quality, string format="{0}")
    public static string GetQualityNameWithColor(int quality, string format = "{0}")
    {
        return AppendColor(quality, string.Format(format, Language.Get("equipQuality" + quality)), true, 1);
    }
@@ -1325,4 +1325,11 @@
        return money / scale;
    }
    public static string RemoveColor(string content)
    {
        content = WordAnalysis.Color_Start_Regex.Replace(content, string.Empty);
        content = WordAnalysis.Color_End_Regex.Replace(content, string.Empty);
        return content;
    }
}