| | |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | //通用玩家个人排行榜 |
| | | //通用玩家个人排行榜; cell数量是固定的 非动态变化 |
| | | public class PlayerRankWin : UIBase |
| | | { |
| | | [SerializeField] List<PlayerTop3Cell> playerTop3Cells; |
| | |
| | | [SerializeField] PlayerRankCell myRankCell; |
| | | [SerializeField] Button btnClose; |
| | | |
| | | |
| | | [HideInInspector] public int rankType; |
| | | [HideInInspector] public string valueFormat = "{0}"; |
| | | //数据后续从manager中记录获取 |
| | | [HideInInspector] public int groupValue1 = 0; //一般用于跨服 |
| | | [HideInInspector] public int groupValue2 = 0; //一般用于跨服 |
| | | protected int rankType; //从functionOrder获取 |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | btnClose.AddListener(()=> |
| | | { |
| | | CloseWindow(); |
| | | }); |
| | | btnClose?.AddListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void NextFrameAfterOpen() |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | rankType = functionOrder; |
| | | RankModel.Instance.onRankRefresh += OnRankRefresh; |
| | | scrollerController.OnRefreshCell += OnRefreshCell; |
| | | Refresh(); |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | |
| | | |
| | | public override void Refresh() |
| | | { |
| | | cmpStrText.text = Language.Get("RankTypeName_1"); |
| | | cmpStrText.text = RankModel.Instance.GetCmpTabStr(rankType); |
| | | ShowTop3(); |
| | | CreateScroller(); |
| | | ShowMyRank(); |
| | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PlayerRankCell>(); |
| | | _cell.Display(rankType, cell.index + 1, valueFormat); |
| | | _cell.Display(rankType, cell.index + 1); |
| | | RankModel.Instance.ListenRankPage(rankType, cell.index, groupValue1, groupValue2); |
| | | } |
| | | |
| | |
| | | { |
| | | for (int i = 0; i < playerTop3Cells.Count; i++) |
| | | { |
| | | playerTop3Cells[i].Display(functionOrder, i + 1); |
| | | playerTop3Cells[i].Display(rankType, i + 1); |
| | | } |
| | | } |
| | | |
| | | void ShowMyRank() |
| | | { |
| | | myRankCell.Display(rankType, 0, valueFormat); |
| | | myRankCell.Display(rankType, 0); |
| | | } |
| | | |
| | | |