| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 | 
							- using FairyGUI;
 
- using ET;
 
- using System.Collections.Generic;
 
- using System;
 
- using UI.CommonGame;
 
- namespace GFGGame
 
- {
 
-     public class RoleInfoManager : SingletonBase<RoleInfoManager>
 
-     {
 
-         public void Clear()
 
-         {
 
-             _headDatas.Clear();
 
-             _headBorderDatas.Clear();
 
-         }
 
-         private List<int> _headDatas = new List<int>();
 
-         public List<int> headDatas
 
-         {
 
-             get
 
-             {
 
-                 SortHeadDatas();
 
-                 return _headDatas;
 
-             }
 
-         }
 
-         private List<int> _headBorderDatas = new List<int>();
 
-         public List<int> headBorderDatas
 
-         {
 
-             get
 
-             {
 
-                 SortHeadBorderDatas();
 
-                 return _headBorderDatas;
 
-             }
 
-         }
 
-         public void Add(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_headDatas.IndexOf(itemId) < 0) _headDatas.Add(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_headBorderDatas.IndexOf(itemId) < 0) _headBorderDatas.Add(itemId);
 
-             }
 
-         }
 
-         public void Remove(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_headDatas.IndexOf(itemId) >= 0) _headDatas.Remove(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_headBorderDatas.IndexOf(itemId) >= 0) _headBorderDatas.Remove(itemId);
 
-             }
 
-         }
 
-         private List<int> _newHeadDatas = new List<int>();
 
-         private List<int> _newHeadBorderDatas = new List<int>();
 
-         public void AddNew(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_newHeadDatas.IndexOf(itemId) >= 0) _newHeadDatas.Add(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_newHeadBorderDatas.IndexOf(itemId) >= 0) _newHeadBorderDatas.Add(itemId);
 
-             }
 
-         }
 
-         public void RemoveNew(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_newHeadDatas.IndexOf(itemId) >= 0) _newHeadDatas.Remove(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_newHeadBorderDatas.IndexOf(itemId) >= 0) _newHeadBorderDatas.Remove(itemId);
 
-             }
 
-         }
 
-         private void SortHeadDatas()
 
-         {
 
-             _headDatas.Sort((int a, int b) =>
 
-             {
 
-                 if (a == RoleDataManager.headId && b != RoleDataManager.headId) return a - b;
 
-                 if (a != RoleDataManager.headId && b == RoleDataManager.headId) return b - a;
 
-                 if (_newHeadDatas.IndexOf(a) >= 0 && _newHeadDatas.IndexOf(b) < 0) return a - b;
 
-                 if (_newHeadDatas.IndexOf(a) < 0 && _newHeadDatas.IndexOf(b) >= 0) return b - a;
 
-                 return b - a;
 
-             });
 
-         }
 
-         private void SortHeadBorderDatas()
 
-         {
 
-             _headBorderDatas.Sort((int a, int b) =>
 
-             {
 
-                 return b - a;
 
-             });
 
-         }
 
-         public decimal GetGuideProgress()
 
-         {
 
-             int suitHaveCount = 0;
 
-             int suitTotalCount = 1;
 
-             DressUpMenuSuitDataManager.GetTotalProgress(out suitHaveCount, out suitTotalCount);
 
-             int chapterItemHaveCount = 0;
 
-             int chapterItemTotalCount = 1;
 
-             InstanceZonesDataManager.GetTotalProgress(out chapterItemHaveCount, out chapterItemTotalCount);
 
-             int travelHaveCount = 0;
 
-             int travelTotalCount = 1;
 
-             TravelDataManager.Instance.GetTotalTravelProgress(out travelHaveCount, out travelTotalCount);
 
-             int haveCount = suitHaveCount + chapterItemHaveCount + travelHaveCount;
 
-             int totalCount = suitTotalCount + chapterItemTotalCount + travelTotalCount;
 
-             decimal value = Math.Floor((decimal)100 * haveCount / totalCount);
 
-             return value;
 
-         }
 
-         public void UpdateHead(GComponent component, int roleId, int roleBorderId)
 
-         {
 
-             ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(roleId == 0 ? ConstItemID.HEADID : roleId);
 
-             ItemCfg headBorderCfg = ItemCfgArray.Instance.GetCfg(roleBorderId == 0 ? ConstItemID.HEADBORDERID : roleBorderId);
 
-             UI_ComHead comHead = UI_ComHead.Proxy(component);
 
-             comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
 
-             comHead.m_loaBorder.url = ResPathUtil.GetHeadBorderPath(headBorderCfg.res);
 
-             UI_ComHead.ProxyEnd();
 
-         }
 
-     }
 
- }
 
 
  |