hch
2025-08-02 0b72d489d989007a827c1f8ca33248441a6e85f9
Main/System/HeroUI/HeroUIManager.cs
@@ -93,7 +93,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 +177,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)
                var country = (HeroCountry)team.tempHeroes[i].heroConfig.Country;
                if (!heroCountryCount.ContainsKey(country))
                {
                    if (!heroCountryCount.ContainsKey(hero.heroCountry))
                    {
                        heroCountryCount.Add(hero.heroCountry, 1);
                    heroCountryCount.Add(country, 1);
                    }
                    else
                    {
                        heroCountryCount[hero.heroCountry] += 1;
                    heroCountryCount[country] = heroCountryCount[country] + 1;
                    }
                }
            }
        }
@@ -226,7 +241,7 @@
        //推荐阵容的算法逻辑
        //自动选择优先级:武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID
        var tmpList = HeroManager.Instance.GetHeroGuidList();
        tmpList.Sort(CmpHeroByTeamType);
        tmpList.Sort(CmpHeroRecommend);
        //推荐最多6个,存在相同heroid,则跳过