Esempio n. 1
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 = "暂无活动";
        }
    }