| using System.Collections; | 
| using System.Collections.Generic; | 
| using UnityEngine; | 
| using UnityEngine.UI; | 
|   | 
| /// <summary> | 
| /// 武将列表 | 
| /// </summary> | 
| public class HeroListWin : UIBase | 
| { | 
|     [SerializeField] Button heroPackBtn; | 
|     [SerializeField] Text heroPackText; | 
|     [SerializeField] ScrollerController heroListScroller; | 
|     [SerializeField] GameObject heroListEmpty; | 
|     [SerializeField] List<Text> attrOnList; //上阵属性加成 | 
|     [SerializeField] GameObject attrOnTip; | 
|     [SerializeField] Button attrOnTipBtn; | 
|   | 
|     [SerializeField] GameObject foldObject; | 
|     [SerializeField] Button unFoldBtn; //展开按钮 | 
|     [SerializeField] List<Button> countryBtnList; | 
|     [SerializeField] GameObject unFoldObject; | 
|     [SerializeField] Button foldBtn; //收起按钮 | 
|     [SerializeField] List<Button> jobBtnList;   //全部,输出、肉盾、辅助、控制 | 
|     [SerializeField] Button changeHeroPosBtn; //布阵按钮 | 
|   | 
|   | 
|     private List<Image> countrySelectImgList; | 
|     private List<Image> jobSelectImgList; | 
|   | 
|     /// </summary> | 
|     protected override void InitComponent() | 
|     { | 
|   | 
|     } | 
|   | 
|   | 
|     protected override void OnPreOpen() | 
|     { | 
|         heroListScroller.OnRefreshCell += OnRefreshCell; | 
|         HeroManager.Instance.SortHeroList(); | 
|         CreateScroller(); | 
|     } | 
|   | 
|     protected override void OnPreClose() | 
|     { | 
|         heroListScroller.OnRefreshCell -= OnRefreshCell; | 
|     } | 
|   | 
|   | 
|     public override void Refresh() | 
|     { | 
|   | 
|     } | 
|   | 
|     void OnRefreshCell(ScrollerDataType type, CellView cell) | 
|     { | 
|         var _cell = cell as HeroCardLineCell; | 
|         _cell.Display(cell.index); | 
|     } | 
|   | 
|     void CreateScroller() | 
|     { | 
|         heroListScroller.Refresh(); | 
|         for (int i = 0; i < HeroManager.Instance.heroSortList.Count; i++) | 
|         {  | 
|             heroListScroller.AddCell(ScrollerDataType.Header, i); | 
|         } | 
|         heroListScroller.Restart(); | 
|     } | 
|   | 
|   | 
|      | 
| } |