Пример #1
0
        public void init(Variant d)
        {
            debug.Log("初始化激活码类型::" + d["tp"] + "  " + d["functp"]);
            bool flag = d.ContainsKey("crttm");

            if (flag)
            {
                this.acttm = d["crttm"];
                debug.Log("crttm::" + d["crttm"]);
            }
            this.id     = d["tp"];
            this.functp = d["functp"];
            this.endTm  = d["fintm"];
            this.name   = d["name"];
            bool flag2 = d.ContainsKey("golden");

            if (flag2)
            {
                this.money = d["golden"];
            }
            bool flag3 = d.ContainsKey("yb");

            if (flag3)
            {
                this.golden = d["yb"];
            }
            bool flag4 = d.ContainsKey("bndyb");

            if (flag4)
            {
                this.yinpiao = d["bndyb"];
            }
            bool flag5 = d.ContainsKey("desc");

            if (flag5)
            {
                this.desc = d["desc"];
            }
            bool flag6 = d.ContainsKey("itm");

            if (flag6)
            {
                this.lItem = new List <BaseItemData>();
                List <Variant> arr = d["itm"]._arr;
                for (int i = 0; i < arr.Count; i++)
                {
                    BaseItemData baseItemData = new BaseItemData();
                    baseItemData.id  = arr[i]["id"];
                    baseItemData.num = arr[i]["cnt"];
                    this.lItem.Add(baseItemData);
                }
            }
        }
Пример #2
0
        public void init(Variant d)
        {
            debug.Log("初始化激活码类型::" + d["tp"] + "  " + d["functp"]);

            if (d.ContainsKey("crttm"))
            {
                acttm = d["crttm"];
                debug.Log("crttm::" + d["crttm"]);
            }

            id     = d["tp"];
            functp = d["functp"];
            endTm  = d["fintm"];
            name   = d["name"];
            if (d.ContainsKey("golden"))
            {
                money = d["golden"];
            }
            if (d.ContainsKey("yb"))
            {
                golden = d["yb"];
            }
            if (d.ContainsKey("bndyb"))
            {
                yinpiao = d["bndyb"];
            }

            if (d.ContainsKey("desc"))
            {
                desc = d["desc"];
            }

            if (d.ContainsKey("itm"))
            {
                lItem = new List <BaseItemData>();
                List <Variant> lItemVa = d["itm"]._arr;
                for (int i = 0; i < lItemVa.Count; i++)
                {
                    BaseItemData itemdata = new BaseItemData();
                    itemdata.id  = lItemVa[i]["id"];
                    itemdata.num = lItemVa[i]["cnt"];
                    lItem.Add(itemdata);
                }
            }
        }