using vnxbqy.UI;
|
using System;
|
using System.Collections.Generic;
|
using UnityEngine.UI;
|
using System.Linq;
|
using LitJson;
|
|
public class BagSelectModel : ILModel<BagSelectModel>
|
{
|
public Dictionary<int, int> bagTabs = new Dictionary<int, int>(); //背包分栏
|
public Dictionary<int, int> holidayBagTabs = new Dictionary<int, int>(); //节日背包分栏
|
//public event Action SelectEvent;
|
|
//默认选中0,因为这里的背包是跳转界面
|
private int m_SelectType;
|
public int selectType
|
{
|
get { return m_SelectType; }
|
set
|
{
|
m_SelectType = value;
|
//SelectEvent?.Invoke();
|
}
|
|
}
|
protected override void Init()
|
{
|
var funcConfig = FuncConfigConfig.Get("OpenBag");
|
var json = JsonMapper.ToObject(funcConfig.Numerical1);
|
var jsonList = json.Keys.ToList();
|
|
bagTabs.Clear();
|
for (int i = 0; i < jsonList.Count; i++)
|
{
|
var typeKey = jsonList[i];
|
var type = int.Parse(typeKey);
|
bagTabs.Add(type, int.Parse(json[typeKey].ToString()));
|
}
|
|
json = JsonMapper.ToObject(funcConfig.Numerical2);
|
jsonList = json.Keys.ToList();
|
|
holidayBagTabs.Clear();
|
for (int i = 0; i < jsonList.Count; i++)
|
{
|
var typeKey = jsonList[i];
|
var type = int.Parse(typeKey);
|
holidayBagTabs.Add(type, int.Parse(json[typeKey].ToString()));
|
}
|
}
|
|
protected override void UnInit()
|
{
|
|
}
|
|
|
}
|