public void loadDuiHuanJiLu() { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanPanelScript_hotfix", "loadDuiHuanJiLu")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanPanelScript_hotfix", "loadDuiHuanJiLu", null, null); return; } m_listView_duihuanjilu.clear(); int count = MedalDuiHuanRecordData.getInstance().getDataList().Count; for (int i = 0; i < count; i++) { GameObject pre = Resources.Load("Prefabs/UI/Item/Item_medalDuiHuanJilu") as GameObject; GameObject obj = Instantiate(pre); MedalDuiHuanRecordDataContent temp = MedalDuiHuanRecordData.getInstance().getDataList()[i]; if (temp != null) { MedalDuiHuanRewardDataContent temp2 = MedalDuiHuanRewardData.getInstance().getMedalDuiHuanRewardDataContentById(temp.goods_id); obj.transform.Find("Text_name").GetComponent <Text>().text = (temp2.name + "*" + temp.num.ToString()); obj.transform.Find("Text_time").GetComponent <Text>().text = temp.time; } m_listView_duihuanjilu.addItem(obj); } m_listView_duihuanjilu.addItemEnd(); }
public static MedalDuiHuanRecordData getInstance() { if (s_instance == null) { s_instance = new MedalDuiHuanRecordData(); } return(s_instance); }
public void onCallBackGetMedalDuiHuanRecord(string data) { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanPanelScript_hotfix", "onCallBackGetMedalDuiHuanRecord")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanPanelScript_hotfix", "onCallBackGetMedalDuiHuanRecord", null, data); return; } MedalDuiHuanRecordData.getInstance().initJson(data); showTab(m_curShowTab); }
public void onReceive_BuyGoods(string data) { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanQueRenPanelScript_hotfix", "onReceive_BuyGoods")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanQueRenPanelScript_hotfix", "onReceive_BuyGoods", null, data); return; } NetLoading.getInstance().Close(); JsonData jd = JsonMapper.ToObject(data); int code = (int)jd["code"]; if (code == (int)TLJCommon.Consts.Code.Code_OK) { ToastScript.createToast("兑换成功"); string reward = (string)jd["reward"]; // 扣除徽章 { int totalPrice = m_medalDuiHuanRewardData.price * m_goods_num; GameUtil.changeData(110, -totalPrice); OtherData.s_medalDuiHuanPanelScript.m_text_myMedalNum.text = UserData.medal.ToString(); } // 奖励加到内存 { List <string> list1 = new List <string>(); CommonUtil.splitStr(reward, list1, ';'); for (int i = 0; i < list1.Count; i++) { List <string> list2 = new List <string>(); CommonUtil.splitStr(list1[i], list2, ':'); int prop_id = int.Parse(list2[0]); int prop_num = int.Parse(list2[1]); GameUtil.changeData(prop_id, prop_num); } } // 增加兑换记录 { MedalDuiHuanRecordDataContent temp = new MedalDuiHuanRecordDataContent(); temp.goods_id = m_medalDuiHuanRewardData.goods_id; temp.num = m_goods_num; string year = CommonUtil.getCurYear().ToString(); string month = CommonUtil.getCurMonth().ToString(); if (month.Length == 1) { month = ("0" + month); } string day = CommonUtil.getCurDay().ToString(); if (day.Length == 1) { day = ("0" + day); } temp.time = year + "年" + month + "月" + day + "日"; MedalDuiHuanRecordData.getInstance().getDataList().Insert(0, temp); } for (int i = 0; i < m_goods_num; i++) { ShowRewardPanelScript.Show(reward, false); } Destroy(gameObject); } else { string msg = (string)jd["msg"]; ToastScript.createToast(msg); } }