Exemplo n.º 1
0
    public void onEventReqUpdateEmail(object data)
    {
        LobbyEvent.sV2C_ReqUpdateEmail re = (LobbyEvent.sV2C_ReqUpdateEmail)data;
        msgReqUpdateEmail msg             = new msgReqUpdateEmail();

        msg.type         = re.type;
        msg.awardEmailId = re.id;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_UPDATE_EMAIL, msg, OnRespUpdateEmail);

        ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_LOADING_ANI, true);
    }
Exemplo n.º 2
0
    public void onShowUpdateEmailResult(object data)
    {
        LobbyEvent.sV2C_ReqUpdateEmail re = (LobbyEvent.sV2C_ReqUpdateEmail)data;

        int index = -1;

        for (int i = 0; i < _emailList.Count; i++)
        {
            if (_emailList [i].getEmailID() == re.id)
            {
                index = i;
                break;
            }
        }
        if (index == -1)
        {
            return;
        }

        if (re.type == CommonDefine.eUpdateEmailType.READ)
        {
            //设置已读
            _emailList [index].updateHasRead();
        }
        else if (re.type == CommonDefine.eUpdateEmailType.DEL)
        {
            //删除
            Destroy(_emailList [index].gameObject);
            _emailList.RemoveAt(index);
            //需要刷新整个界面
            //将默认选择移动到第一个,设置当前选择
            updateDefaultSelect();
        }
        else if (re.type == CommonDefine.eUpdateEmailType.GET_AWARD)
        {
            //恭喜获得xx 提示
            ViewManagerEvent.s_ShowDialog d;
            d.callBack  = onClickDialogBtn;
            d.hasCancel = false;
            d.hasClose  = true;
            d.hasOk     = false;
            d.tip       = "温馨提示";
            CommonUtil.EmailContent content = _emailList [index].getContent();
            if (content.type == CommonUtil.EmailContent.AWARD_TYPE.GOLD)
            {
                d.tip = "恭喜获得" + content.awardCnt + "积分!祝您游戏愉快~";
            }
            else if (_emailList [index].getContent().type == CommonUtil.EmailContent.AWARD_TYPE.PROP)
            {
                d.tip = "恭喜获得永久皮肤" + "吃遍天下" + "!祝您游戏愉快~";
            }

            d.type = CommonDefine.eDialogEventType.LOBBY_EMAIL_GET_AWARD_RESULT;

            ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_DIALOG, (object)d);

            _emailList [index].getContent().hasGottenAward = true;
            //更新
            _awardBtn.interactable = false;
            Text txt = _awardBtn.GetComponentInChildren <Text> ();
            txt.text = "已领取";

            //all btn
            Invoke("checkIsGettingAllAward", 0.001f);
        }
        updateReadUnRead();
    }