少年修仙传客户端代码仓库
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
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()
    {
        
    }
 
 
}