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
using System;
using System.Collections.Generic;
using LitJson;
 
public class SuperVipManager : GameSystemManager<SuperVipManager>
{
    /// <summary>渠道门槛配置 {渠道名: 累充金额/元}</summary>
    public Dictionary<string, int> channelThresholdDict = new Dictionary<string, int>();
    /// <summary>客服领取奖励列表 [[物品ID, 个数], ...]</summary>
    public int[][] customerServiceRewards;
 
    public override void Init()
    {
        var config = FuncConfigConfig.Get("SuperVIP");
        channelThresholdDict = JsonMapper.ToObject<Dictionary<string, int>>(config.Numerical1);
        customerServiceRewards = JsonMapper.ToObject<int[][]>(config.Numerical2);
    }
 
    public override void Release()
    {
 
    }
 
    /// <summary>
    /// 判定SuperVIP入口是否开启
    /// 条件: 当前渠道在配置表中 且 历史累充 >= 配置门槛(元) * 100
    /// </summary>
    public bool IsEntryOpen()
    {
        var appId = VersionConfig.Get().appId;
        if (!channelThresholdDict.TryGetValue(appId, out var thresholdYuan))
            return false;
        return RechargeManager.Instance.realRecharge >= thresholdYuan * 100;
    }
}