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;
|
}
|
}
|