Beispiel #1
0
    public void onReceive_GetReward(string json)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc(m_hotfix_class, "onReceive_GetReward"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke(m_hotfix_path, "onReceive_GetReward", null, json);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(json);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            string reward = jd["reward"].ToString();
            GameUtil.changeDataWithStr(reward);
            ShowRewardPanelScript.Show(reward, false);

            // UI变化
            {
                int id = (int)jd["id"];

                Button obj = gameObject.transform.Find("Button_" + id).GetComponent <Button>();
                obj.interactable = false;
                obj.transform.Find("Text").GetComponent <Text>().text = "已领取";
            }
        }
        else
        {
            string msg = jd["msg"].ToString();
            ToastScript.createToast(msg);
        }
    }
    public void onReceive_ReadMail(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Mail_List_Item_Script_hotfix", "onReceive_ReadMail"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Mail_List_Item_Script_hotfix", "onReceive_ReadMail", null, data);
            return;
        }

        JsonData jd       = JsonMapper.ToObject(data);
        int      code     = (int)jd["code"];
        int      email_id = (int)jd["email_id"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            m_parentScript.setMailReaded(email_id);

            if (OtherData.s_mainScript != null)
            {
                OtherData.s_mainScript.checkRedPoint();
            }

            //ShowRewardPanelScript.create().GetComponent<ShowRewardPanelScript>().setData(m_mailData.m_reward);
            if (!string.IsNullOrEmpty(m_mailData.m_reward))
            {
                ShowRewardPanelScript.Show(m_mailData.m_reward, false);
            }
        }

        MailDetailScript.create(int.Parse(gameObject.transform.name), m_parentScript);
    }
Beispiel #3
0
    // 所有邮件设为已读
    public void setAllMailReaded()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("UserMailData_hotfix", "setAllMailReaded"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.UserMailData_hotfix", "setAllMailReaded", null, null);
            return;
        }

        for (int i = 0; i < m_myMailDataList.Count; i++)
        {
            if (m_myMailDataList[i].m_state == 0)
            {
                if (!string.IsNullOrEmpty(m_myMailDataList[i].m_reward))
                {
                    m_myMailDataList[i].m_state = 1;

                    // 增加奖励
                    {
                        List <CommonClass.Reward> rewardList = UserMailData.getInstance().getUserMailDataById(m_myMailDataList[i].m_email_id).m_rewardList;
                        for (int j = 0; j < rewardList.Count; j++)
                        {
                            GameUtil.changeData(rewardList[j].m_id, rewardList[j].m_num);
                        }
                    }

                    //ShowRewardPanelScript.create().GetComponent<ShowRewardPanelScript>().setData(m_myMailDataList[i].m_reward);
                    ShowRewardPanelScript.Show(m_myMailDataList[i].m_reward, false);
                }
            }
        }
    }
Beispiel #4
0
    public void onReceive_CompleteTask(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Item_Task_List_Script_hotfix", "onReceive_CompleteTask"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Item_Task_List_Script_hotfix", "onReceive_CompleteTask", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd      = JsonMapper.ToObject(data);
        int      code    = (int)jd["code"];
        int      task_id = (int)jd["task_id"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("领取成功");

            m_parentScript.setTaskOver(task_id);

            if (OtherData.s_mainScript != null)
            {
                OtherData.s_mainScript.checkRedPoint();
            }

            string reward = TaskDataScript.getInstance().getTaskDataById(task_id).reward;

            // 增加奖励
            if (!string.IsNullOrEmpty(reward))
            {
                List <string> list = new List <string>();
                CommonUtil.splitStr(reward, list, ';');

                for (int i = 0; i < list.Count; i++)
                {
                    List <string> tempList = new List <string>();
                    CommonUtil.splitStr(list[i], tempList, ':');

                    GameUtil.changeData(int.Parse(tempList[0]), int.Parse(tempList[1]));
                }

                //ShowRewardPanelScript.create().GetComponent<ShowRewardPanelScript>().setData(TaskDataScript.getInstance().getTaskDataById(task_id).reward);
                ShowRewardPanelScript.Show(reward, false);
            }
        }
        else
        {
            ToastScript.createToast("领取失败");
        }
    }
    public void onCallBackBindTuiGuangCode(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ShuRuTuiGuangCodePanelScript_hotfix", "onCallBackBindTuiGuangCode"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ShuRuTuiGuangCodePanelScript_hotfix", "onCallBackBindTuiGuangCode", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jsonData = JsonMapper.ToObject(data);
        int      code     = (int)jsonData["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            string reward = (string)jsonData["reward"];

            if (reward.CompareTo("") != 0)
            {
                List <string> list = new List <string>();
                CommonUtil.splitStr(reward, list, ';');
                for (int i = 0; i < list.Count; i++)
                {
                    GameUtil.changeData(GameUtil.getPropIdFromReward(list[i]), GameUtil.getPropNumFromReward(list[i]));

                    ShowRewardPanelScript.Show(reward, false);
                }

                ToastScript.createToast("领取奖励成功");

                Destroy(gameObject);
            }
            else
            {
                ToastScript.createToast("异常:奖励为空");
            }
        }
        else
        {
            string msg = (string)jsonData["msg"];

            ToastScript.createToast(msg);
        }
    }
    public void onInvokeRunRotateEnd()
    {
        {
            string reward = TurntableDataScript.getInstance().getDataById(int.Parse(m_targetGameObject.transform.name)).m_reward;

            // 加到内存
            GameUtil.changeDataWithStr(reward);

            // 显示奖励
            ShowRewardPanelScript.Show(reward, true);

            // 显示在转盘通知列表
            addTurntableBroadcast(UserData.name, int.Parse(m_targetGameObject.transform.name));

            m_isStartRotate = false;

            // 旋转结束后允许此界面可被关闭
            gameObject.GetComponent <ScaleUtil>().setCanClose(true);
        }
    }
    public void onReceive_HuaFeiSuiPianDuiHuan(string json)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Activity_huafeisuipian_Script_hotfix", "onReceive_HuaFeiSuiPianDuiHuan"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Activity_huafeisuipian_Script_hotfix", "onReceive_HuaFeiSuiPianDuiHuan", null, json);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd = JsonMapper.ToObject(json);

        int code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            int duihuan_id = (int)jd["duihuan_id"];
            HuaFeiSuiPianDuiHuanDataContent temp = HuaFeiSuiPianDuiHuanData.getInstance().getDataById(duihuan_id);

            {
                GameUtil.changeData(temp.Synthesis_id, temp.Synthesis_num);
                GameUtil.changeData(temp.material_id, -temp.material_num);

                ShowRewardPanelScript.Show(temp.Synthesis_id.ToString() + ":" + temp.Synthesis_num.ToString(), false);
            }

            refreshMyMaterialNum();
        }
        else
        {
            string msg = (string)jd["msg"];

            ToastScript.createToast(msg);
        }
    }
    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);
        }
    }
    public void onCallBackOneKeyGetAllTuiGuangReward(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TuiGuangYouLiPanelScript_hotfix", "onCallBackOneKeyGetAllTuiGuangReward"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TuiGuangYouLiPanelScript_hotfix", "onCallBackOneKeyGetAllTuiGuangReward", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jsonData = JsonMapper.ToObject(data);
        int      code     = (int)jsonData["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            // 禁用一键领取按钮
            m_btn_yijianlingqu.interactable = false;

            string reward = (string)jsonData["reward"];

            if (reward.CompareTo("") != 0)
            {
                List <string> list = new List <string>();
                CommonUtil.splitStr(reward, list, ';');
                for (int i = 0; i < list.Count; i++)
                {
                    GameUtil.changeData(GameUtil.getPropIdFromReward(list[i]), GameUtil.getPropNumFromReward(list[i]));

                    ShowRewardPanelScript.Show(list[i], false);
                }

                for (int i = 0; i < MyTuiGuangData.getInstance().getMyTuiGuangDataList().Count; i++)
                {
                    MyTuiGuangDataContent temp = MyTuiGuangData.getInstance().getMyTuiGuangDataList()[i];

                    GameObject obj = null;
                    for (int j = 0; j < m_listview_player.getItemList().Count; j++)
                    {
                        if (m_listview_player.getItemList()[j].transform.name.CompareTo(temp.uid) == 0)
                        {
                            obj = m_listview_player.getItemList()[j];
                            break;
                        }
                    }

                    if (temp.task1_state == 2)
                    {
                        temp.task1_state = 3;

                        obj.transform.Find("Text_task1_state").GetComponent <Text>().text          = "";
                        obj.transform.Find("Text_task1_state/Image_yilingqu").transform.localScale = new Vector3(1, 1, 1);
                        CommonUtil.setFontColor(obj.transform.Find("Text_task1_state").GetComponent <Text>(), 99, 99, 99);
                    }

                    if (temp.task2_state == 2)
                    {
                        temp.task2_state = 3;

                        obj.transform.Find("Text_task2_state").GetComponent <Text>().text          = "";
                        obj.transform.Find("Text_task2_state/Image_yilingqu").transform.localScale = new Vector3(1, 1, 1);
                        CommonUtil.setFontColor(obj.transform.Find("Text_task2_state").GetComponent <Text>(), 99, 99, 99);
                    }
                }

                ToastScript.createToast("领取奖励成功");
            }
            else
            {
                ToastScript.createToast("当前没有奖励可领取");
            }
        }
        else
        {
            string msg = (string)jsonData["msg"];

            ToastScript.createToast(msg);
        }
    }
    public void onReceive_Sign30(string result)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Sign30PanelScript_hotfix", "onReceive_Sign30"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Sign30PanelScript_hotfix", "onReceive_Sign30", null, result);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd = JsonMapper.ToObject(result);

        int code = (int)jd["code"];
        int type = (int)jd["type"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            int    id          = (int)jd["id"];
            string reward_prop = (string)jd["reward_prop"];

            // 奖励加到内存
            {
                List <string> list1 = new List <string>();
                CommonUtil.splitStr(reward_prop, 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);
                }
            }

            ShowRewardPanelScript.Show(reward_prop, false);

            switch (type)
            {
            // 今天签到
            case 1:
            {
                ToastScript.createToast("签到成功");

                {
                    Sign30RecordData.getInstance().getSign30RecordList().Add(id);

                    m_text_lianxuqiandaotianshu.text = "累计签到天数:" + Sign30RecordData.getInstance().getSign30RecordList().Count.ToString() + "天";

                    GameObject obj = transform.Find("Image_bg/" + (id - 1).ToString()).gameObject;
                    obj.transform.Find("Image_yiqian").localScale = new Vector3(1, 1, 1);
                    obj.transform.Find("Image_buqian").localScale = new Vector3(0, 0, 0);
                    //obj.transform.Find("Image_yiguoqi").localScale = new Vector3(0, 0, 0);
                    //obj.transform.Find("Image_icon").localScale = new Vector3(0, 0, 0);

                    OtherData.s_mainScript.checkRedPoint();

                    setBtnSignState(Sign30Data.getInstance().getSign30DataById(id).day);
                    setLeiJiSignState();
                }
            }
            break;

            // 补签
            case 2:
            {
                ToastScript.createToast("补签成功");

                {
                    Sign30RecordData.getInstance().getSign30RecordList().Add(id);

                    m_text_lianxuqiandaotianshu.text = "累计签到天数:" + Sign30RecordData.getInstance().getSign30RecordList().Count.ToString() + "天";

                    GameObject obj = transform.Find("Image_bg/" + (id - 1).ToString()).gameObject;
                    obj.transform.Find("Image_yiqian").localScale = new Vector3(1, 1, 1);
                    obj.transform.Find("Image_buqian").localScale = new Vector3(0, 0, 0);

                    //obj.transform.Find("Image_icon").localScale = new Vector3(0, 0, 0);
                }

                Destroy(OtherData.s_buQianQueRenPanelScript.gameObject);

                // 扣除补签费
                GameUtil.changeData(1, -OtherData.s_buQianQueRenPanelScript.getBuQianGoldHuaFei());

                // 增加补签次数
                ++Sign30RecordData.getInstance().m_curMonthBuQianCount;

                setBtnSignState(Sign30Data.getInstance().getSign30DataById(id).day);
                setLeiJiSignState();
            }
            break;

            // 累计签到奖励
            case 3:
            {
                Destroy(OtherData.s_sign30LeiJiPanelScript.gameObject);

                Sign30RecordData.getInstance().getSign30LeiJiRecordList().Add(id);
                setLeiJiSignState();

                ToastScript.createToast("领取奖励成功");
            }
            break;
            }
        }
        else
        {
            string msg = (string)jd["msg"];
            ToastScript.createToast(msg);
        }
    }
    private void Update()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("WeeklySignScript_hotfix", "Update"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.WeeklySignScript_hotfix", "Update", null, null);
            return;
        }

        //签到成功后,做的一些ui操作
        if (isSignSuccess)
        {
            GameObject signObject = signObjects[totalSignDays];
            var        name       = signObject.transform.GetChild(2);
            Transform  image_lingqu;
            if (SignData.SignWeekDays == 6)
            {
                image_lingqu = signObject.transform.GetChild(3);
            }
            else
            {
                image_lingqu = signObject.transform.GetChild(4);
            }
            //            var image_prop = signObject.transform.GetChild(2);
            var guang = signObject.transform.GetChild(0);
            //取消点击事件
            signObject.GetComponent <Button>().enabled = false;

            //取消光
//            Transform child = guang.transform.GetChild(0);
//
//            Destroy(child.gameObject);

//            Color color = signObject.GetComponent<Image>().color;
//            color.r = 0.5f;
//            color.g = 0.5f;
//            color.b = 0.5f;
//            name.GetComponent<Text>().color = color;
//            image_prop.GetComponent<Image>().color = color;
//            signObject.GetComponent<Image>().color = color;

//            go.transform.localScale = Vector3.zero;

            image_lingqu.transform.localScale = Vector3.one;
            btn_Sign.transform.localScale     = Vector3.zero;
            image_Signed.transform.localScale = Vector3.one;

            if (SignData.SignWeekDays == 6)
            {
                signObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("Sprites/Sign/item_bg_big2");
            }
            else
            {
                signObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("Sprites/Sign/item_bg_smail2");
            }

            SignData.IsSign = true;
            SignData.SignWeekDays++;
            isSignSuccess = false;

            SignItem signItem = _signItems[totalSignDays];
            LogUtil.Log(signItem.goods_prop);
            AddProp(signItem.goods_prop);

            //ShowRewardPanelScript.create().GetComponent<ShowRewardPanelScript>().setData(signItem.goods_prop);
            ShowRewardPanelScript.Show(signItem.goods_prop, false);

            if (OtherData.s_mainScript != null)
            {
                OtherData.s_mainScript.checkRedPoint();
            }
        }
    }