Ejemplo n.º 1
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_LOGINSTATE_ENTER:
            {
                this.LoadView();
                this.SetVisible(true);
            }
            break;

            case WndMsgID.WND_MSG_SYSTEMFLOATTEXT_CREATE:
            {
                if (m_wndView != null)
                {
                    USystemFloatTextData textData = data as USystemFloatTextData;
                    m_wndView.CreateFloatText(textData);
                }
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        //上传文件
        public void UploadFile(byte[] fileData)
        {
            if (bUploadFinish)
            {
                USystemFloatTextData uploadmsg = new USystemFloatTextData();
                uploadmsg.message   = ULocalizationService.Instance.Get("UIView", "GloryMoment", "Uploading");
                uploadmsg.nPos      = 1;
                uploadmsg.nShowTime = 2000;
                USpeedUI.UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SYSTEMFLOATTEXT_CREATE, uploadmsg);

                StopCoroutine("TransmitPicture");
                StartCoroutine(TransmitPicture(fileData));
            }
        }
Ejemplo n.º 3
0
        public void CreateFloatText(USystemFloatTextData data)
        {
            if (data.nPos > posYArr.Length || data.nPos < 1)
            {
                data.nPos = 1;
            }
            floatText.rectTransform.anchoredPosition = new Vector2(0, posYArr[data.nPos - 1]);
            string stInfo = data.message;

            UBB.toHtml(ref stInfo, UBB_FORMAT_TYPE.UGUI);
            floatText.text = stInfo;
            if (data.nShowTime < 0)
            {
                data.nShowTime = 0;
            }
            showTime = data.nShowTime;
            floatText.gameObject.SetActive(true);
        }
Ejemplo n.º 4
0
        //上传至服务器
        IEnumerator TransmitPicture(byte[] fileData)
        {
            bUploadFinish = false;
            checkPoint    = GameLogicAPI.getTickCount();

            WWWForm form = new WWWForm();

            form.AddBinaryData("shareImg", fileData, "shareImg.jpg");
            WWW www = new WWW("http://res.szgla.com/UploadCS.axd?gameid=7&showlogo=80", form);

            yield return(www);

            if (www.error != null)
            {
                Debug.Log(www.error);

                USystemFloatTextData failedMessage = new USystemFloatTextData();
                failedMessage.message   = ULocalizationService.Instance.Get("UIView", "GloryMoment", "UploadFailed");
                failedMessage.nPos      = 1;
                failedMessage.nShowTime = 2000;
                USpeedUI.UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SYSTEMFLOATTEXT_CREATE, failedMessage);

                yield return(null);
            }
            else
            {
                string url = www.text;

                if (SocialShareUploadEvent != null)
                {
                    SocialShareUploadEvent(url);
                }

                USystemFloatTextData successMessage = new USystemFloatTextData();
                successMessage.message   = ULocalizationService.Instance.Get("UIView", "GloryMoment", "UploadSuccessed");
                successMessage.nPos      = 1;
                successMessage.nShowTime = 2000;
                USpeedUI.UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SYSTEMFLOATTEXT_CREATE, successMessage);
            }
            bUploadFinish = true;
        }