少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
94
95
96
97
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, July 18, 2018
//--------------------------------------------------------
using vnxbqy.UI;
using System;
using System.Collections.Generic;
using UnityEngine;
 
 
public class CZBMModel : Model
{
    int m_SelectIndex = 0;
    public int selectIndex
    {
        get { return m_SelectIndex; }
        set
        {
            if (m_SelectIndex != value)
            {
                m_SelectIndex = value;
                if (selectUpdate != null)
                {
                    selectUpdate();
                }
            }
        }
    }
    Redpoint redpoint = new Redpoint(434, 440);
    VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
    HAA31_tagMCActGrowupBuyInfo netData;
    public event Action selectUpdate;
 
    public override void Init()
    {
        m_SelectIndex = 0;
    }
 
    public override void UnInit()
    {
 
    }
 
    public HAA31_tagMCActGrowupBuyInfo.tagMCActGrowupBuyCTGItem[] GetGiftsByCTGID(int ctgID)
    {
        OperationCZBM operation;
        if (OperationTimeHepler.Instance.TryGetOperation(Operation.CZBMGift, out operation))
        {
 
            for (int i = 0; i < operation.CZBMGiftInfo.Count; i++)
            {
                for (int j = 0; j < operation.CZBMGiftInfo[i].BuyCTGIDList.Length; j++)
                {
                    if (operation.CZBMGiftInfo[i].BuyCTGIDList[j].CTGID == ctgID)
                    {
                        return operation.CZBMGiftInfo[i].BuyCTGIDList[j].GainItemList;
                    }
                }
            }
        }
 
        return null;
    }
 
    public void ReceivePackage(HAA31_tagMCActGrowupBuyInfo vNetData)
    {
        netData = vNetData;
        UpdateRedpoint();
    }
 
    void UpdateRedpoint()
    {
        redpoint.state = RedPointState.None;
        if (DayRemind.Instance.GetDayRemind(DayRemind.CZBM_REDPOINT))
            return;
        if (!OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.CZBMGift))
            return;
        for (int i = 0; i < netData.GroupCount; i++)
        {
            for (int j = 0; j < netData.GroupList[i].BuyCount; j++)
            {
                VipModel.RechargeCount rechargeCnt;
                vipModel.TryGetRechargeCount(netData.GroupList[i].BuyCTGIDList[j].CTGID, out rechargeCnt);
                if (rechargeCnt.totalCount == 0)
                {
                    redpoint.state = RedPointState.Simple;
                    break;
                }
            }
        }
    }
    public void CloseRedpoint()
    {
        redpoint.state = RedPointState.None;
    }
 
}