| using System; | 
| using System.Collections; | 
| using System.Collections.Generic; | 
|   | 
| using UnityEngine; | 
|   | 
| public partial class HeroUIManager : GameSystemManager<HeroUIManager> | 
| { | 
|   | 
|     #region 图鉴和皮肤 | 
|   | 
|     //图鉴和皮肤的激活情况 | 
|     public Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic { get; private set; } = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>(); | 
|   | 
|     public int bookPer; | 
|     public event Action OnHeroCollectEvent; | 
|   | 
|     public void UpdateHeroCollectInfo(HB122_tagSCHeroInfo netPack) | 
|     { | 
|         for (int i = 0; i < netPack.HeroCnt; i++) | 
|         { | 
|             heroCollectInfoDic[(int)netPack.HeroInfoList[i].HeroID] = netPack.HeroInfoList[i]; | 
|         } | 
|         bookPer = GetHeroCollectBookPer(); | 
|         OnHeroCollectEvent?.Invoke(); | 
|     } | 
|   | 
|   | 
|     public int GetHeroCollectBookPer() | 
|     { | 
|         int per = 0; | 
|         foreach (var kv in heroCollectInfoDic) | 
|         { | 
|             var config = HeroQualityConfig.Get(HeroConfig.Get(kv.Key).Quality); | 
|             if (kv.Value.BookInitState != 2) | 
|                 continue; | 
|             per += config.BookInitAddPer; | 
|             per += kv.Value.BookStarLV * config.BookStarAddPer; | 
|             per += kv.Value.BookBreakLV * config.BookBreakLVAddPer; | 
|         } | 
|         return per; | 
|     } | 
|   | 
|     public HB122_tagSCHeroInfo.tagSCHero GetHeroBookInfo(int heroID) | 
|     {  | 
|         if (heroCollectInfoDic.ContainsKey(heroID)) | 
|         { | 
|             return heroCollectInfoDic[heroID]; | 
|         } | 
|         return null; | 
|     } | 
|   | 
|     #endregion | 
| } |