hch
昨天 890d0dd7547c18dbffb3339c12007d87876af7ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using UnityEngine;
using UnityEngine.UI;
 
 
//历练秘笈
public class ExpSecretCollectionWin : UIBase
{
    [SerializeField] Text costzcText;
    [SerializeField] Text addExpText;
    [SerializeField] Text addMoneyText;
    [SerializeField] ScrollerController scroller;
    [SerializeField] Button buyBtn;
    [SerializeField] Text buyText;
    [SerializeField] Transform buyYetRect;
 
 
    protected override void InitComponent()
    {
        buyBtn.AddListener(() =>
        {
            RechargeManager.Instance.CTG(ExpSecretCollectionManager.Instance.ctgID);
        });
    }
 
    protected override void OnPreOpen()
    {
 
        ExpSecretCollectionManager.Instance.UpdateExpSecretCollectionEvent += OnExpSecretCollectionEvent;
        scroller.OnRefreshCell += OnRefreshCell;
        CreateScroller();
        Display();
    }
 
 
    protected override void OnPreClose()
    {
        ExpSecretCollectionManager.Instance.UpdateExpSecretCollectionEvent -= OnExpSecretCollectionEvent;
        scroller.OnRefreshCell -= OnRefreshCell;
    }
 
    void CreateScroller()
    {
        scroller.Refresh();
        var keys = LLMJConfig.GetKeys();
        keys.Sort();
        foreach (var key in keys)
        {
            scroller.AddCell(ScrollerDataType.Header, key);
        }
        scroller.Restart();
        scroller.JumpIndex(ExpSecretCollectionManager.Instance.m_MJLV - 1);
    }
 
    void OnRefreshCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as ExpSecretCollectionCell;
        _cell.Display(cell.index);
    }
 
    void OnExpSecretCollectionEvent()
    {
        Display();
    }
 
    void Display()
    {
        costzcText.text = ExpSecretCollectionManager.Instance.m_Zhanchui >= 1000000 ?
            UIHelper.ReplaceLargeNum(ExpSecretCollectionManager.Instance.m_Zhanchui) :
            ExpSecretCollectionManager.Instance.m_Zhanchui.ToString();
 
        var config = LLMJConfig.Get(ExpSecretCollectionManager.Instance.m_MJLV);
 
        if (ExpSecretCollectionManager.Instance.m_MJLV == 0)
        {
            addExpText.text = "0";
            addMoneyText.text = "0";
        }
        else
        {
            addExpText.text = ExpSecretCollectionManager.Instance.m_ExpEx + "/" + config.ExpExUpper;
            addMoneyText.text = ExpSecretCollectionManager.Instance.m_DecomposeEx + "/" + config.DecomposeExUpper;
        }        
 
        buyBtn.SetActive(ExpSecretCollectionManager.Instance.m_MJLV == 0);
        RechargeManager.Instance.TryGetOrderInfo(ExpSecretCollectionManager.Instance.ctgID, out var orderInfoConfig);
        buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
        buyYetRect.SetActive(ExpSecretCollectionManager.Instance.m_MJLV != 0);
 
        scroller.m_Scorller.RefreshActiveCellViews();
    }
 
}