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
using System.Collections.Generic;
using UnityEngine.UI;
using System.Linq;
using LitJson;
using System;
 
// 历练秘笈
public class ExpSecretCollectionManager : GameSystemManager<ExpSecretCollectionManager>
{
    public int ctgID;
 
    public byte m_MJLV;    // 秘笈等级,激活后从1开始
    public uint m_Zhanchui;    // 秘笈累计消耗战锤
    public uint m_ExpEx;    // 秘笈今日已额外获得经验
    public uint m_DecomposeEx;    // 秘笈今日已额外获得分解货币
 
    public event Action UpdateExpSecretCollectionEvent;
 
    public override void Init()
    {
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
        var config = FuncConfigConfig.Get("LLMJ");
        ctgID = int.Parse(config.Numerical1);
    }
 
    public override void Release()
    {
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
    }
 
    void OnBeforePlayerDataInitialize()
    {
        m_MJLV = 0;
        m_Zhanchui = 0;
        m_ExpEx = 0;
        m_DecomposeEx = 0;
    }
 
    public void OnExpSecretCollection(HB128_tagSCLLMJInfo netPack)
    {
        m_MJLV = netPack.MJLV;
        m_Zhanchui = netPack.Zhanchui;
        m_ExpEx = netPack.ExpEx;
        m_DecomposeEx = netPack.DecomposeEx;
        UpdateExpSecretCollectionEvent?.Invoke();
        UpdateRedpoint();
    }
 
    public Redpoint redPointLLMJ = new Redpoint(MainRedDot.RightFuncRedpoint, MainRedDot.RedPoint_LLMJKey);
    void UpdateRedpoint()
    {
        if (m_MJLV == 0) return;
        var nextConfig = LLMJConfig.Get(m_MJLV + 1);
        if (nextConfig == null) return;
        if (m_Zhanchui >= nextConfig.CostWarhammer)
        {
            redPointLLMJ.state = RedPointState.Simple;
        }
        else
        {
            redPointLLMJ.state = RedPointState.None;
        }
    }
}