| | |
| | |
|
| | | private void ParseCTGConfig()
|
| | | {
|
| | | var _configs = Config.Instance.GetAllValues<OrderInfoConfig>();
|
| | | var configs = Config.Instance.GetAllValues<OrderInfoConfig>();
|
| | | m_RechargeGainItemDict = new Dictionary<int, List<AwardItem>>();
|
| | | for (int i = 0; i < _configs.Count; i++)
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | if (_configs[i].CTGID == 0)
|
| | | List<OrderInfoConfig> list;
|
| | | if (!m_OrderInfoDict.TryGetValue(configs[i].AppId, out list))
|
| | | {
|
| | | list = new List<OrderInfoConfig>();
|
| | | m_OrderInfoDict.Add(configs[i].AppId, list);
|
| | | }
|
| | | list.Add(configs[i]);
|
| | | if (configs[i].CTGID == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | List<int> _list = null;
|
| | | if (!m_CTGConfigDict.TryGetValue(_configs[i].AppId, out _list))
|
| | | if (!m_CTGConfigDict.TryGetValue(configs[i].AppId, out _list))
|
| | | {
|
| | | _list = new List<int>();
|
| | | m_CTGConfigDict.Add(_configs[i].AppId, _list);
|
| | | m_CTGConfigDict.Add(configs[i].AppId, _list);
|
| | | }
|
| | | _list.Add(_configs[i].CTGID);
|
| | | if (!m_RechargeGainItemDict.ContainsKey(_configs[i].CTGID))
|
| | | _list.Add(configs[i].CTGID);
|
| | | if (!m_RechargeGainItemDict.ContainsKey(configs[i].CTGID))
|
| | | {
|
| | | var ctg = Config.Instance.Get<CTGConfig>(_configs[i].CTGID);
|
| | | var ctg = Config.Instance.Get<CTGConfig>(configs[i].CTGID);
|
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(ctg.GainItemList);
|
| | | if (_itemArray != null && _itemArray.Length > 0)
|
| | | {
|
| | | var _itemList = new List<AwardItem>();
|
| | | m_RechargeGainItemDict.Add(_configs[i].CTGID, _itemList);
|
| | | m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
|
| | | for (int k = 0; k < _itemArray.Length; k++)
|
| | | {
|
| | | AwardItem _item = new AwardItem()
|
| | |
| | | return m_CTGConfigDict[_appid];
|
| | | }
|
| | | return m_CTGConfigDict.Values.Last();
|
| | | }
|
| | |
|
| | | public bool TryGetRechargeItem(int id, out List<AwardItem> list)
|
| | | {
|
| | | return m_RechargeGainItemDict.TryGetValue(id, out list);
|
| | | }
|
| | |
|
| | | private Dictionary<int, List<AwardItem>> m_FirstChargeItemDict = new Dictionary<int, List<AwardItem>>();
|
| | |
| | | public Dictionary<int, int> firstRechargeWeapon { get; private set; }
|
| | | public Dictionary<int, List<AwardItem>> m_RechargeGainItemDict { get; private set; }
|
| | | private Dictionary<int, RechargeCount> m_RechargeCountDict = new Dictionary<int, RechargeCount>();
|
| | | Dictionary<string, List<OrderInfoConfig>> m_OrderInfoDict = new Dictionary<string, List<OrderInfoConfig>>();
|
| | | public int presentSelectRechargeId { get; private set; }
|
| | | public bool beforeRecharge { get; private set; }
|
| | | private int beforeVipLv { get; set; }
|
| | |
| | | public bool TryGetOrderInfo(int _id, out OrderInfoConfig config)
|
| | | {
|
| | | config = null;
|
| | | var configs = Config.Instance.GetAllValues<OrderInfoConfig>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | if (_id == 0)
|
| | | {
|
| | | if (configs[i].AppId.Equals(VersionConfig.Get().appId)
|
| | | && configs[i].CTGID == _id)
|
| | | return false;
|
| | | }
|
| | | List<OrderInfoConfig> list;
|
| | | if (m_OrderInfoDict.TryGetValue(VersionConfig.Get().appId, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | config = configs[i];
|
| | | return true;
|
| | | if (list[i].CTGID == _id)
|
| | | {
|
| | | config = list[i];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | |
| | | var ctgconfig = Config.Instance.Get<CTGConfig>(config.CTGID);
|
| | | if (!VersionConfig.Get().appId.Equals(config.AppId))
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | MessageWin.Inst.ShowFixedTip("Appid不对应...");
|
| | | #endif
|
| | | return;
|
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge))
|
| | | {
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip((int)FuncOpenEnum.Recharge);
|
| | | return;
|
| | | }
|
| | |
|