コード例 #1
0
        void createEquip()
        {
            Dictionary <a3_ItemData, uint> itemDataList = WelfareModel.getInstance().getFirstChargeDataList();

            foreach (KeyValuePair <a3_ItemData, uint> item in itemDataList)
            {
                a3_ItemData itemData = item.Key;
                if (item.Value != 0)
                {
                    if (item.Value == (uint)PlayerModel.getInstance().profession)
                    {
                        GameObject con  = this.transform.FindChild("body/awardItems/equip").gameObject;
                        GameObject clon = (GameObject)Instantiate(con);
                        clon.SetActive(true);
                        clon.transform.SetParent(content2d, false);
                        GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(itemData, true);
                        icon.transform.FindChild("iconborder").gameObject.SetActive(false);
                        icon.transform.SetParent(clon.transform, false);
                        icon.gameObject.SetActive(true);
                        new BaseButton(icon.transform).onClick = (GameObject go) =>
                        {
                            setTip(item.Key, true);
                        };
                    }
                }
            }
        }
コード例 #2
0
 void setTotalData(Variant data)
 {
     //累积消费
     if (data.ContainsKey("total_xiaofei"))
     {
         uint total_xiaofei = data["total_xiaofei"];
         b_leijixiaofei = WelfareModel.getInstance().for_leixjixiaofei(leijixiaofei);
         // showIconLight();
     }
     //累积充值
     if (data.ContainsKey("total_recharge"))
     {
         totalRecharge   = data["total_recharge"];
         b_leijizhongzhi = WelfareModel.getInstance().for_leijichongzhi(leijichongzhi);
         // showIconLight();
     }
     //累积日充值
     if (data.ContainsKey("richong"))
     {
         uint richong = data["richong"];
         todayTotal_recharge = richong;
         if (a3_awardCenter._instance)
         {
             a3_awardCenter._instance.RefreshInfo();
         }
         // b_leijichongzhi_today = WelfareModel.getInstance().for_jinrichongzhi(dailyGift);
         // showIconLight();
     }
 }
コード例 #3
0
        void createItem()
        {
            Dictionary <a3_ItemData, uint> itemDataList = WelfareModel.getInstance().getFirstChargeDataList();

            foreach (KeyValuePair <a3_ItemData, uint> item in itemDataList)
            {
                a3_ItemData itemData = item.Key;
                if (item.Value == 0)
                {
                    GameObject con  = this.transform.FindChild("body/awardItems/item").gameObject;
                    GameObject clon = (GameObject)Instantiate(con);
                    clon.SetActive(true);
                    clon.transform.SetParent(content2d, false);
                    GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(itemData, true, -1, 0.9f);
                    icon.transform.SetParent(clon.transform, false);
                    new BaseButton(icon.transform).onClick = (GameObject go) =>
                    {
                        setTip(item.Key);
                    };
                    //LayoutElement le = icon.AddComponent<LayoutElement>();
                    //le.minHeight = 100.0f;
                    //le.minWidth = 100.0f;
                    //le.preferredHeight = 100.0f;
                    //le.preferredWidth = 100.0f;
                    icon.gameObject.SetActive(true);
                    //icon.transform.localScale = Vector3.one;
                }
            }
        }
コード例 #4
0
        void setAccumulateConsumption(Variant data) //累积消费
        {
            uint gift_id = data["gift_id"];         //礼包id

            b_leijixiaofei = WelfareModel.getInstance().for_leixjixiaofei(leijixiaofei);
            // showIconLight();
            dispatchEvent(GameEvent.Create(ACCUMULATECONSUMPTION, this, data));
        }
コード例 #5
0
        void setAccumulateRecharge(Variant data) //累积充值
        {
            uint gift_id = data["gift_id"];      //礼包id

            b_leijizhongzhi = WelfareModel.getInstance().for_leijichongzhi(leijichongzhi);
            //showIconLight();
            dispatchEvent(GameEvent.Create(ACCUMULATERECHARGE, this, data));
        }
コード例 #6
0
        void setLvlAward(Variant data)      //等级奖励
        {
            uint gift_id = data["gift_id"]; //礼包id

            dengjijiangli.Add(gift_id);
            b_zhuan = WelfareModel.getInstance().for_dengjilibao(dengjijiangli);
            //showIconLight();
            dispatchEvent(GameEvent.Create(UPLEVELAWARD, this, data));
        }
コード例 #7
0
        void createAward(uint dayCount)
        {
            //for (int n=0;n< objlist.Count;n++) {
            //    objlist[n].des();
            //}
            //objlist.Clear();
            awdlist.Clear();
            List <WelfareModel.itemWelfareData> iwdList = WelfareModel.getInstance().getDailyLogin();

            for (int i = 0; i < iwdList.Count; i++)
            {
                if (i < 7)
                {
                    WelfareModel.itemWelfareData iwd = iwdList[i];
                    a3_ItemData itemData             = a3_BagModel.getInstance().getItemDataById(iwd.itemId);
                    bool        claim  = false;
                    bool        canget = false;
                    if (i < dayCount)
                    {
                        claim = true;
                    }

                    if (i == dayCount)
                    {
                        canget = true;
                    }

                    GameObject goItemAward = transform.FindChild("body/awardItems/content/itemAward" + (i + 1)).gameObject;

                    itemAwardData iad = new itemAwardData();
                    iad.parent = _content;
                    iad.trSelf = goItemAward.transform;
                    //iad.trAward = goIcon.transform;./seven_day 1
                    iad.dayNum    = (uint)i;
                    iad.dayCount  = dayCount;
                    iad.isChecked = claim;
                    iad.canGet    = canget;
                    iad.name      = itemData.item_name;
                    iad.awardnum  = iwd.num;
                    // itemAward ad = new itemAward(iad);
                    // objlist.Add(ad);
                    SetAwd(iad);
                    awdlist[i + 1] = iad;
                }
            }
        }
コード例 #8
0
        void setWelfare(Variant data)               //福利相关
        {
            totalRecharge = data["total_recharge"]; //总计充值
            totalXiaofei  = data["total_xiaofei"];  //总计消费
            firstRecharge = data["first_recharge"]; //首冲

            Variant sendData = new Variant();

            sendData["show"] = firstRecharge <= 0 ? true : false;
            dispatchEvent(GameEvent.Create(SHOWFIRSTRECHARGE, this, sendData));
            //在线时间
            Variant onlineTimeData = data["zaixianshijian"];
            uint    statusType     = onlineTimeData["status_type"];  //奖励buff类型
            uint    endTm          = onlineTimeData["end_tm"];       //buff结束时间
            uint    statusCount    = onlineTimeData["status_count"]; //领取在线奖励的次数
            //累计登录奖励
            Variant leijidenglu = data["leijidenglu"];
            uint    last_day    = leijidenglu["last_day"];  //最后领取的时间
            uint    day_count   = leijidenglu["day_count"]; //领奖的天数位置

            debug.Log(last_day.ToString() + "--->>");
            bool canGetAward = CheckTime(last_day);

            if (day_count < 7 && canGetAward && FunctionOpenMgr.instance.Check(FunctionOpenMgr.SEVEN_DAY))
            {
                //凌晨刷新
                if ((old_day == DateTime.Now.Day && _isShowEveryDataLogin) || !_isShowEveryDataLogin)
                {
                    old_day = DateTime.Now.Day;
                    ArrayList arry = new ArrayList();
                    arry.Add(last_day);       //最后领取的时间
                    arry.Add(day_count);      //领奖的天数位置
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EVERYDAYLOGIN, arry);
                    _isShowEveryDataLogin = true;

                    if (a3_expbar.instance != null)
                    {
                        a3_expbar.instance.getGameObjectByPath("operator/LightTips/everyDayLogin").SetActive(true);
                    }
                }
            }
            //日充值奖励
            Variant richongjiangli = data["richongjiangli"];

            todayTotal_recharge = richongjiangli["total_recharge"];//今天充值了多少

            // dailyGifts = richongjiangli["gift"]._arr;//领取过的礼包

            foreach (int i in richongjiangli["gift"]._arr)
            {
                if (!dailyGift.Contains(i))
                {
                    dailyGift.Add(i);
                }
            }
            //b_leijichongzhi_today= WelfareModel.getInstance().for_jinrichongzhi(dailyGift);
            //等级礼包
            dengjijiangli = data["dengjijiangli"]._arr;
            b_zhuan       = WelfareModel.getInstance().for_dengjilibao(dengjijiangli);
            //累计充值
            leijichongzhi   = data["leijichongzhi"]._arr;
            b_leijizhongzhi = WelfareModel.getInstance().for_leijichongzhi(leijichongzhi);
            //累计消费
            leijixiaofei   = data["leijixiaofei"]._arr;
            b_leijixiaofei = WelfareModel.getInstance().for_leixjixiaofei(leijixiaofei);


            //showIconLight();
        }