yyl
2025-08-05 06da72770c641fabf980816ed466a2280dac2be7
Main/System/HeroUI/HeroUIManager.cs
@@ -40,6 +40,18 @@
    public void QueryUnLockHeroPack()
    {
        //解锁更多的武将背包
        int canBuyCnt = PackManager.Instance.GetCanBuyPackGirdCount(PackType.Hero);
        if (canBuyCnt <= 0)
        {
            return;
        }
        ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
        Language.Get("HeroPack1", GeneralDefine.MoneyDisplayModel[1],1, 1), (bool isOK)=>
        {
        });
    }
    //刷新时机, 打开武将界面 或者 关闭功能界面
@@ -93,7 +105,24 @@
    #region 布阵界面
    public List<string> heroOnTeamSortList { get; private set; } = new List<string>();    //不同上阵的列表排序
    public TeamType selectTeamType = TeamType.Story;  //当前选中的是哪个阵容, 布阵相关逻辑使用
    private TeamType m_SelectTeamType = TeamType.Story; //当前选中的是哪个阵容, 布阵相关逻辑使用
    public TeamType selectTeamType
    {
        get { return m_SelectTeamType; }
        set
        {
            if (m_SelectTeamType == value)
                return;
            //上一个阵容需要恢复到原状态
            if (m_SelectTeamType != TeamType.None)
            {
                TeamManager.Instance.GetTeam(m_SelectTeamType).RestoreTeam();
            }
            m_SelectTeamType = value;
        }
    }
    public int selectTeamPosJob = 0;    //布阵界面 筛选职业
    public int selectTeamPosCountry = 0;    //布阵界面 筛选国家
@@ -160,23 +189,21 @@
        var team = TeamManager.Instance.GetTeam(teamType);
        if (team != null)
        {
            for (int i = 0; i < team.serverHeroes.Length; i++)
            for (int i = 0; i < team.tempHeroes.Length; i++)
            {
                if (team.serverHeroes[i] == null)
                if (team.tempHeroes[i] == null)
                    continue;
                var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid);
                if (hero != null)
                {
                    if (!heroCountryCount.ContainsKey(hero.heroCountry))
                    {
                        heroCountryCount.Add(hero.heroCountry, 1);
                    }
                    else
                    {
                        heroCountryCount[hero.heroCountry] += 1;
                    }
                var country = (HeroCountry)team.tempHeroes[i].heroConfig.Country;
                if (!heroCountryCount.ContainsKey(country))
                {
                    heroCountryCount.Add(country, 1);
                }
                else
                {
                    heroCountryCount[country] = heroCountryCount[country] + 1;
                }
            }
        }
@@ -226,7 +253,7 @@
        //推荐阵容的算法逻辑
        //自动选择优先级:武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID
        var tmpList = HeroManager.Instance.GetHeroGuidList();
        tmpList.Sort(CmpHeroByTeamType);
        tmpList.Sort(CmpHeroRecommend);
        //推荐最多6个,存在相同heroid,则跳过