hch
2025-08-02 0b72d489d989007a827c1f8ca33248441a6e85f9
Main/System/Hero/HeroManager.cs
@@ -40,7 +40,7 @@
    void OnBeforePlayerDataInitialize()
    {
        heroInfoDict.Clear();
    }
@@ -73,7 +73,7 @@
            heroInfoDict.TryGetValue(guid, out heroInfo);
            heroInfoDict.Remove(guid);
            if (null != heroInfo)
                onHeroDeleteEvent?.Invoke(heroInfo);
        }
@@ -95,12 +95,27 @@
    {
        if (job == 0 && country == 0)
            return heroInfoDict.Keys.ToList();
        return heroInfoDict.Keys.Where((x) =>
        List<string> retGuidList = new List<string>();
        foreach (string guid in heroInfoDict.Keys)
        {
            HeroInfo heroInfo = heroInfoDict[x];
            return heroInfo.heroConfig.Class == job && heroInfo.heroConfig.Country == country;
        }).ToList();
            HeroInfo heroInfo = heroInfoDict[guid];
            //0代表全部
            if (job == 0 || country == 0)
            {
                if (job != 0 && job == heroInfo.heroConfig.Class)
                    retGuidList.Add(guid);
                if (country != 0 && country == heroInfo.heroConfig.Country)
                    retGuidList.Add(guid);
            }
            else
            {
                if (job == heroInfo.heroConfig.Class && country == heroInfo.heroConfig.Country)
                    retGuidList.Add(guid);
            }
        }
        return retGuidList;
    }
    public List<HeroInfo> GetPowerfulHeroList()
@@ -131,7 +146,10 @@
    }
    public int GetHeroCount()
    {
        return heroInfoDict.Count;
    }
}