public void loadChat()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChatPanelScript_hotfix", "loadChat"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChatPanelScript_hotfix", "loadChat", null, null);
            return;
        }

        {
            m_tab_bg.transform.localPosition = new Vector3(-83, 0, 0);
            CommonUtil.setImageSpriteByAssetBundle(m_button_chat.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "btn_chat_xuanze");
            CommonUtil.setImageSpriteByAssetBundle(m_button_biaoqing.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "btn_emogi_weixuanze");
        }

        m_ListViewScript_chat.clear();

        GameUtil.showGameObject(m_listView_chat);
        GameUtil.hideGameObject(m_listView_emoji);

        for (int i = 0; i < ChatData.getInstance().getChatTextList().Count; i++)
        {
            GameObject prefab = Resources.Load("Prefabs/UI/Item/Item_chat_List") as GameObject;
            GameObject obj    = MonoBehaviour.Instantiate(prefab);
            obj.GetComponent <Item_chat_List_Script>().m_parentScript = this;
            obj.GetComponent <Item_chat_List_Script>().setChatData(ChatData.getInstance().getChatTextList()[i]);

            m_ListViewScript_chat.addItem(obj);
        }

        m_ListViewScript_chat.addItemEnd();
    }
    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 void loadTask()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TaskPanelScript_hotfix", "loadTask"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TaskPanelScript_hotfix", "loadTask", null, null);
            return;
        }

        m_ListViewScript.clear();

        for (int i = 0; i < TaskDataScript.getInstance().getTaskDataList().Count; i++)
        {
            GameObject prefab = Resources.Load("Prefabs/UI/Item/Item_Task_List") as GameObject;
            GameObject obj    = MonoBehaviour.Instantiate(prefab);
            obj.GetComponent <Item_Task_List_Script>().m_parentScript = this;
            obj.GetComponent <Item_Task_List_Script>().setTaskData(TaskDataScript.getInstance().getTaskDataList()[i]);

            obj.transform.name = TaskDataScript.getInstance().getTaskDataList()[i].task_id.ToString();

            m_ListViewScript.addItem(obj);
        }

        m_ListViewScript.addItemEnd();
    }
    public void loadList()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Activity_huafeisuipian_Script_hotfix", "loadList"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.Activity_huafeisuipian_Script_hotfix", "loadList", null, null);
            return;
        }

        m_ListViewScript.clear();

        for (int i = 0; i < HuaFeiSuiPianDuiHuanData.getInstance().getDataList().Count; i++)
        {
            HuaFeiSuiPianDuiHuanDataContent temp = HuaFeiSuiPianDuiHuanData.getInstance().getDataList()[i];

            GameObject prefab = Resources.Load("Prefabs/UI/Item/Item_huafeisuipian") as GameObject;
            GameObject obj    = MonoBehaviour.Instantiate(prefab);
            obj.transform.name = temp.duihuan_id.ToString();

            {
                CommonUtil.setImageSprite(obj.transform.Find("Image_icon_suipian").GetComponent <Image>(), GameUtil.getPropIconPath(temp.material_id));
                obj.transform.Find("Image_icon_suipian/Text").GetComponent <Text>().text = GameUtil.getMyPropNumById(temp.material_id).ToString() + "/" + temp.material_num;
                CommonUtil.setImageSprite(obj.transform.Find("Image_icon_huafei").GetComponent <Image>(), GameUtil.getPropIconPath(temp.Synthesis_id));

                obj.transform.Find("Button_duihuan").GetComponent <Button>().onClick.AddListener(() => onClickDuiHuan(obj));
            }

            m_ListViewScript.addItem(obj);
        }

        m_ListViewScript.addItemEnd();
    }
    public void loadBiaoQing()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChatPanelScript_hotfix", "loadBiaoQing"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChatPanelScript_hotfix", "loadBiaoQing", null, null);
            return;
        }

        {
            {
                m_tab_bg.transform.localPosition = new Vector3(83, 0, 0);

                CommonUtil.setImageSpriteByAssetBundle(m_button_chat.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "btn_chat_weixuanze");
                CommonUtil.setImageSpriteByAssetBundle(m_button_biaoqing.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "btn_emogi_xuanze");
            }
        }

        m_ListViewScript_emoji.clear();

        GameUtil.hideGameObject(m_listView_chat);
        GameUtil.showGameObject(m_listView_emoji);

        {
            GameObject obj = new GameObject();
            for (int i = 0; i < 16; i++)
            {
                GameObject button = new GameObject();
                button.AddComponent <Image>();
                button.AddComponent <Button>();
                button.transform.name = i.ToString();

                button.GetComponent <Button>().onClick.AddListener(delegate()
                {
                    int id = int.Parse(button.transform.name);
                    reqChat_emoji(id + 1);
                });

                string path = "Expression-" + (i + 1) + "_1";
                CommonUtil.setImageSpriteByAssetBundle(button.GetComponent <Image>(), "emoji.unity3d", path);
                button.GetComponent <Image>().SetNativeSize();

                if (i % 6 == 0)
                {
                    obj = new GameObject();
                    m_ListViewScript_emoji.addItem(obj);
                }

                button.transform.SetParent(obj.transform);

                button.transform.localPosition = new Vector3(-250 + (i % 6) * 100, 0, 0);
            }

            m_ListViewScript_emoji.addItemEnd();
        }
    }
Esempio n. 6
0
    // 显示活动
    public void loadHuoDong()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("NoticePanelScript_hotfix", "loadHuoDong"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.NoticePanelScript_hotfix", "loadHuoDong", null, null);
            return;
        }

        m_curShowHuoDong = true;

        m_ListViewScript.clear();

        for (int i = 0; i < NoticelDataScript.getInstance().getNoticeDataList().Count; i++)
        {
            if (NoticelDataScript.getInstance().getNoticeDataList()[i].type == 0)
            {
                GameObject prefab = Resources.Load("Prefabs/UI/Item/Item_Notice_List") as GameObject;
                GameObject obj    = MonoBehaviour.Instantiate(prefab);
                obj.GetComponent <Item_Notice_List_Script>().m_parentScript = this;
                obj.GetComponent <Item_Notice_List_Script>().setNoticeData(NoticelDataScript.getInstance().getNoticeDataList()[i]);

                obj.transform.name = NoticelDataScript.getInstance().getNoticeDataList()[i].notice_id.ToString();

                m_ListViewScript.addItem(obj);
            }
        }

        m_ListViewScript.addItemEnd();

        if (m_ListViewScript.getItemCount() > 0)
        {
            m_text_zanwu.transform.localScale = new Vector3(0, 0, 0);
        }
        else
        {
            m_text_zanwu.transform.localScale = new Vector3(1, 1, 1);
            m_text_zanwu.text = "暂无活动";
        }
    }
Esempio n. 7
0
    public void showJinBiChang()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("PVPChoiceScript_hotfix", "showJinBiChang"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.PVPChoiceScript_hotfix", "showJinBiChang", null, null);
            return;
        }

        m_curShowTiaoZhanSai = true;

        m_ListViewScript.clear();

        {
            m_tab_bg.transform.localPosition = new Vector3(-83, 0, 0);
            CommonUtil.setImageSpriteByAssetBundle(m_button_tiaozhansai.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "tiaozhansai_xuanze");
            CommonUtil.setImageSpriteByAssetBundle(m_button_huafeisai.transform.Find("Image").GetComponent <Image>(), "game.unity3d", "huafeisai_weixuanze");
        }

        for (int i = 0; i < PVPGameRoomDataScript.getInstance().getDataList().Count; i++)
        {
            List <string> list = new List <string>();
            CommonUtil.splitStr(PVPGameRoomDataScript.getInstance().getDataList()[i].gameroomtype, list, '_');

            if (list[1].CompareTo("JinBi") == 0)
            {
                GameObject prefab = Resources.Load("Prefabs/UI/Item/PVP_List_Item") as GameObject;
                GameObject obj    = MonoBehaviour.Instantiate(prefab);

                obj.GetComponent <PVP_List_Item_Script>().setPVPGameRoomData(PVPGameRoomDataScript.getInstance().getDataList()[i]);
                m_ListViewScript.addItem(obj);
            }
        }

        m_ListViewScript.addItemEnd();
    }
    public void addTurntableBroadcast(string name, int reward_id)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TurntablePanelScript_hotfix", "addTurntableBroadcast"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TurntablePanelScript_hotfix", "addTurntableBroadcast", null, name, reward_id);
            return;
        }

        try
        {
            TurntableBroadcastDataScript.getInstance().addData(name, reward_id);

            {
                m_ListViewScript.clear();
                for (int i = 0; i < TurntableBroadcastDataScript.getInstance().getTurntableBroadcastDataList().Count; i++)
                {
                    GameObject prefab = Resources.Load("Prefabs/UI/Item/Item_zhuanpan_guangbo") as GameObject;
                    GameObject obj    = MonoBehaviour.Instantiate(prefab);

                    {
                        TurntableBroadcastData temp = TurntableBroadcastDataScript.getInstance().getTurntableBroadcastDataList()[i];

                        TurntableData data = TurntableDataScript.getInstance().getDataById(temp.m_reward_id);
                        if (data != null)
                        {
                            string reward    = TurntableDataScript.getInstance().getDataById(temp.m_reward_id).m_reward;
                            int    prop_id   = CommonUtil.splitStr_Start(reward, ':');
                            int    prop_num  = CommonUtil.splitStr_End(reward, ':');
                            string prop_name = PropData.getInstance().getPropInfoById(prop_id).m_name;

                            string content = "恭喜" + temp.m_name + "获得" + prop_name + "*" + prop_num;
                            obj.transform.Find("Text").GetComponent <Text>().text = content;
                        }
                    }

                    m_ListViewScript.addItem(obj);
                }

                m_ListViewScript.addItemEnd();
            }
        }
        catch (Exception ex)
        {
            LogUtil.Log("addTurntableBroadcast异常----" + ex.Message);
        }
    }
Esempio n. 9
0
    public void loadMail()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("EmailPanelScript_hotfix", "loadMail"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.EmailPanelScript_hotfix", "loadMail", null, null);
            return;
        }

        m_ListViewScript.clear();

        for (int i = 0; i < UserMailData.getInstance().getUserMailDataList().Count; i++)
        {
            GameObject prefab = Resources.Load("Prefabs/UI/Item/Mail_List_Item") as GameObject;
            GameObject obj    = MonoBehaviour.Instantiate(prefab);
            obj.GetComponent <Mail_List_Item_Script>().m_parentScript = this;
            obj.GetComponent <Mail_List_Item_Script>().setMailData(UserMailData.getInstance().getUserMailDataList()[i]);

            obj.transform.name = UserMailData.getInstance().getUserMailDataList()[i].m_email_id.ToString();

            m_ListViewScript.addItem(obj);
        }

        m_ListViewScript.addItemEnd();

        // 判断是否启用:一键领取、一键删除
        {
            bool canUseOneKeyRead   = false;
            bool canUseOneKeyDelete = false;

            if (m_button_oneKeyRead != null)
            {
                m_button_oneKeyRead.transform.localScale   = new Vector3(0, 0, 0);
                m_button_oneKeyDelete.transform.localScale = new Vector3(0, 0, 0);
            }

            for (int i = 0; i < UserMailData.getInstance().getUserMailDataList().Count; i++)
            {
                if (UserMailData.getInstance().getUserMailDataList()[i].m_state == 0)
                {
                    canUseOneKeyRead = true;
                }

                if (UserMailData.getInstance().getUserMailDataList()[i].m_state == 1)
                {
                    canUseOneKeyDelete = true;
                }
            }

            if (canUseOneKeyRead && canUseOneKeyDelete)
            {
                m_button_oneKeyRead.transform.localScale   = new Vector3(1, 1, 1);
                m_button_oneKeyDelete.transform.localScale = new Vector3(1, 1, 1);

                m_button_oneKeyRead.transform.localPosition   = new Vector3(-130, -230.31f, 0);
                m_button_oneKeyDelete.transform.localPosition = new Vector3(130, -230.31f, 0);
            }
            else
            {
                if (canUseOneKeyRead)
                {
                    m_button_oneKeyRead.transform.localScale   = new Vector3(1, 1, 1);
                    m_button_oneKeyDelete.transform.localScale = new Vector3(0, 0, 0);

                    m_button_oneKeyRead.transform.localPosition = new Vector3(0, -230.31f, 0);
                }

                if (canUseOneKeyDelete)
                {
                    m_button_oneKeyDelete.transform.localScale = new Vector3(1, 1, 1);
                    m_button_oneKeyRead.transform.localScale   = new Vector3(0, 0, 0);

                    m_button_oneKeyDelete.transform.localPosition = new Vector3(0, -230.31f, 0);
                }
            }
        }

        m_text_mailNum.text = UserMailData.getInstance().getUserMailDataList().Count + "/50";

        //暂无邮件
        m_text_zanwu.transform.localScale = UserMailData.getInstance().getUserMailDataList().Count == 0 ? Vector3.one : Vector3.zero;
    }
    public void loadMyTuiGuangData()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("TuiGuangYouLiPanelScript_hotfix", "loadMyTuiGuangData"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.TuiGuangYouLiPanelScript_hotfix", "loadMyTuiGuangData", null, null);
            return;
        }

        m_listview_player.clear();

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

            GameObject pre = Resources.Load("Prefabs/UI/Item/Item_TuiJianPlayer") as GameObject;
            GameObject obj = Instantiate(pre);
            obj.transform.name = temp.uid;
            obj.transform.Find("Text_name").GetComponent <Text>().text = temp.name;

            // 任务1
            {
                if (temp.task1_state == 1)
                {
                    obj.transform.Find("Text_task1_state").GetComponent <Text>().text = "未完成";
                }
                else if (temp.task1_state == 2)
                {
                    obj.transform.Find("Text_task1_state").GetComponent <Text>().text = "可领取";
                    CommonUtil.setFontColor(obj.transform.Find("Text_task1_state").GetComponent <Text>(), 251, 75, 9);

                    // 启用一键领取按钮
                    m_btn_yijianlingqu.interactable = true;
                }
                // 已领取
                else if (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);
                }
            }

            // 任务2
            {
                if (temp.task2_state == 1)
                {
                    obj.transform.Find("Text_task2_state").GetComponent <Text>().text = "未完成";
                }
                else if (temp.task2_state == 2)
                {
                    obj.transform.Find("Text_task2_state").GetComponent <Text>().text = "可领取";
                    CommonUtil.setFontColor(obj.transform.Find("Text_task2_state").GetComponent <Text>(), 251, 75, 9);

                    // 启用一键领取按钮
                    m_btn_yijianlingqu.interactable = true;
                }
                // 已领取
                else if (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);
                }
            }

            m_listview_player.addItem(obj);
        }

        m_listview_player.addItemEnd();
    }
    public void loadDuiHuanShangPin()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanPanelScript_hotfix", "loadDuiHuanShangPin"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanPanelScript_hotfix", "loadDuiHuanShangPin", null, null);
            return;
        }

        m_listView_duihuanshangpin.clear();

        int count = MedalDuiHuanRewardData.getInstance().getDataList().Count;
        int rows  = 0;

        if (count == 0)
        {
            rows = 0;
        }
        else if (count < 3)
        {
            rows = 1;
        }
        else
        {
            rows = count / 3;
            if ((count % 3) > 0)
            {
                ++rows;
            }
        }

        int index = 0;

        for (int i = 0; i < rows; i++)
        {
            GameObject pre = Resources.Load("Prefabs/UI/Item/Item_medal_duihuan") as GameObject;
            GameObject obj = Instantiate(pre);

            for (int j = 0; j < 3; j++)
            {
                MedalDuiHuanRewardDataContent temp = MedalDuiHuanRewardData.getInstance().getMedalDuiHuanRewardDataContentByIndex(index++);

                Button btn = obj.transform.Find("Button_" + (j + 1)).GetComponent <Button>();
                if (temp != null)
                {
                    btn.onClick.AddListener(() => onClickItemMedalDuiHuan(btn));

                    btn.transform.name = temp.goods_id.ToString();

                    // 图标
                    CommonUtil.setImageSprite(btn.transform.Find("Image").GetComponent <Image>(), GameUtil.getPropIconPath(GameUtil.getPropIdFromReward(temp.reward_prop)));

                    // 名字
                    btn.transform.Find("Image_btn/Text_price").GetComponent <Text>().text = temp.price.ToString();

                    // vip等级
                    CommonUtil.setImageSpriteByAssetBundle(btn.transform.Find("Image_vip").GetComponent <Image>(), "vip.unity3d", "user_vip_" + temp.vipLevel);
                }
                else
                {
                    GameUtil.hideGameObject(btn.gameObject);
                }
            }

            m_listView_duihuanshangpin.addItem(obj);
        }

        m_listView_duihuanshangpin.addItemEnd();
    }