Beispiel #1
0
        /// <summary>
        /// 分享按钮点击事件
        /// </summary>
        /// <param name="nIndex"></param>
        public void OnShareBtnClick(int nIndex)
        {
            if (!bInit)
            {
                return;
            }

            nIndex++;

            nBtnSelectedIndex = nIndex;
            m_SharePlatform   = (EMSocialSharePlatform)nIndex;

            BtnBorderTransform.anchoredPosition = ((ShareBtnGroup[nIndex - 1].transform) as RectTransform).anchoredPosition;

            BtnBorderTransform.gameObject.SetActive(false);

            if (m_SharePlatform != EMSocialSharePlatform.EMSSP_WECHAT)
            {
                CloseWeChatFrame();
            }

            if (szShareImgUrl == "")
            {
                if (null == shareImgData)
                {
                    shareImgData = ImageExtensions.GetAllByteData(szShareImgPath);
                }
                if (shareImgData != null)
                {
                    SocialShare.GetInstance().UploadFile(shareImgData);
                }
            }

            ShareToPlatform();
        }
Beispiel #2
0
        public void OpenRecordShareFrame()
        {
            string desc = String.Format(ULocalizationService.Instance.Get("UIView", "LifeHeroCulture", "ShareDesc"), EntityFactory.MainHeroView.Property.CreatureName);

            UBB.toHtml(ref desc);
            ShareDesc.text           = desc;
            shareConfirmBtnText.text = ULocalizationService.Instance.Get("UIView", "LifeHeroCulture", "NewChallenge");

            string imgFullPath = CaptureScreen.GetInstance().CaptureTempDir + "/" + shareImgName;

            if (File.Exists(imgFullPath))
            {
                byte[] imgData = ImageExtensions.GetAllByteData(imgFullPath);

                if (null != ShareRawImg)
                {
                    if (null == ShareRawImg.texture)
                    {
                        if (shareTex2D != null)
                        {
                            shareTex2D.LoadImage(imgData);
                        }
                        ShareRawImg.texture = shareTex2D;
                    }
                    ShareRawImg.gameObject.SetActive(true);
                }

                ShareBar.SetData(SocialSharingType.LifeHero, imgData);
            }
            RecordShareFrame.gameObject.SetActive(true);
        }
Beispiel #3
0
        //按类型添加文件
        private void AddDataByType(FileInfo fileInfo)
        {
            if (fileInfo.Extension == ".jpg")
            {
                CaptureImgData imgData = new CaptureImgData();
                imgData.fileInfo = fileInfo;

                byte[] allBytes = ImageExtensions.GetAllByteData(fileInfo.FullName);
                imgData.imgByteData = allBytes;

                SScreenShotImgInfo imgInfo = new SScreenShotImgInfo();
                imgInfo = ImageExtensions.GetCustomData <SScreenShotImgInfo>(allBytes);

                if (imgInfo.nHeroID < 0 || imgInfo.nDBWarID < 0)
                {
                    return;
                }

                imgData.imgInfo = imgInfo;

                string createTime = fileInfo.CreationTime.ToString("yyyy-MM-dd");

                if (!m_ImageFileTable.ContainsKey(createTime))
                {
                    m_ImageFileTable.Add(createTime, new List <CaptureImgData>());
                }
                m_ImageFileTable[createTime].Add(imgData);

                if (imgInfo.nDBWarID > 0)
                {
                    if (!m_DBWarIDList.Contains(imgInfo.nDBWarID))
                    {
                        m_DBWarIDList.Add(imgInfo.nDBWarID);
                    }
                }
            }
            else if (fileInfo.Extension == ".mp4" || fileInfo.Extension == ".avi")
            {
                CaptureVideoData videoData;

                if (!CheckVideo(fileInfo, out videoData))
                {
                    return;
                }

                string createTime = fileInfo.CreationTime.ToString("yyyy-MM-dd");

                if (!m_VideoFileTable.ContainsKey(createTime))
                {
                    m_VideoFileTable.Add(createTime, new List <CaptureVideoData>());
                }
                m_VideoFileTable[createTime].Add(videoData);
            }
        }