hch
2025-12-08 fbc2b42630bd7675370eade11f4b350ff9ede741
Main/System/BillboardRank/PlayerRankWin.cs
@@ -9,7 +9,7 @@
using UnityEngine.UI;
//通用玩家个人排行榜
//通用玩家个人排行榜; cell数量是固定的 非动态变化
public class PlayerRankWin : UIBase
{
    [SerializeField] List<PlayerTop3Cell> playerTop3Cells;
@@ -18,26 +18,23 @@
    [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()
@@ -53,7 +50,7 @@
    public override void Refresh()
    {
        cmpStrText.text = Language.Get("RankTypeName_1");
        cmpStrText.text = RankModel.Instance.GetCmpTabStr(rankType);
        ShowTop3();
        CreateScroller();
        ShowMyRank();
@@ -73,7 +70,7 @@
    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);
    }
@@ -82,13 +79,13 @@
    { 
        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);
    }