Exemplo n.º 1
0
 static int DaoqiTime(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MailItem obj  = (MailItem)ToLua.CheckObject(L, 1, typeof(MailItem));
         int      arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         string   o    = obj.DaoqiTime(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 2
0
    //Item根据数据更新的委托
    void OnInitItemFC(ItemObj item, ItemData data)
    {
        MailData myData   = data as MailData;
        MailItem itemComp = item.m_widget.GetComponent <MailItem>();

        itemComp.SendUserNameLabel.text   = myData.sender;
        itemComp.titleContentLabel.text   = myData.title;
        itemComp.expirationTimeLabel.text = itemComp.DaoqiTime(myData.time);

        itemComp.DaoqiTime(myData.time);
        itemComp.ShowItemTypeAndzuoSP(myData._new, myData.isHaveFujian);
        itemComp.ShowFujianNum(myData.fujianNum, myData._new);
        //是否开启选中图标
        if (MailItem.choseMailID == myData._id)
        {
            itemComp.choseSP.SetActive(true);
        }
        else
        {
            itemComp.choseSP.SetActive(false);
        }


        UIEventListener.Get(itemComp.gameObject).onClick
            = (go) =>
            {
            //选中item更换
            if (MailItem.beChoseSP)
            {
                MailItem.beChoseSP.SetActive(false);
            }
            itemComp.choseSP.SetActive(true);
            MailItem.choseMailID = myData._id;
            MailItem.beChoseSP   = itemComp.choseSP.gameObject;

            //初始化左边的栏目信息//print(myData._id);
            Tools.CallMethod("mailCall", "InitRightWindow", myData._id, myData.isHaveFujian);
            //播放动画
            Tools.CallMethod("mailCall", "ShowRightWindow");
            //发送读取信息  无附件的状态1了就不用发阅读请求  有附件的状态为2了不用发阅读请求
            if (myData.isHaveFujian)
            {
                if (myData._new != 2)
                {
                    if (myData._new != 2)
                    {
                        myData._new = 1;
                    }
                    Tools.CallMethod("mailCall", "SendReadMail", myData._id, myData._new);
                }
            }
            else
            {
                if (myData._new != 1)
                {
                    if (myData._new != 1)
                    {
                        myData._new = 1;
                    }
                    Tools.CallMethod("mailCall", "SendReadMail", myData._id, myData._new);
                    //删除自动删除的无附件邮件
                    if (myData.autoDel == 1)
                    {
                        Tools.CallMethod("mailCall", "SendDelMail", myData._id);
                    }
                }
            }
            //更新信息界面按钮的功能
            Tools.CallMethod("mailCall", "UpdateRight_Btn_lingqufujian", myData._id, myData.isHaveFujian, myData._new, myData.autoDel);
            //无附件的是否需要重置背景
            if (!myData.isHaveFujian)
            {
                itemComp.ShowItemTypeAndzuoSP(myData._new, myData.isHaveFujian);
            }
            };
    }