public void OpenShare() { if (itemType == EMGloryMomentPageType.EMPage_Image) { USocialShareShowMsgData msgData = new USocialShareShowMsgData(); msgData.fileIndex = fileIndex; msgData.imgPath = fileName; msgData.imgData = imgData; msgData.nDBWarID = dbWarID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_OPEN_SOCIALSHARE_FRAME, msgData); } else { //try //{ // System.Diagnostics.Process.Start(fileName); //} //catch (System.Exception ex) //{ // Trace.LogError(ex.ToString()); //} UGloryMomentVideoMsgData msgData = new UGloryMomentVideoMsgData(); msgData.fileIndex = fileIndex; msgData.videoPath = fileName; msgData.nDBWarID = dbWarID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_OPEN_GLORYMOMENT_VIDEO_FRAME, msgData); } }
//打开某一局的精彩时刻截图 public void OpenWarData(UGloryMomentReqMsgData msgData) { if (null == msgData) { return; } int index = m_timeAxisMap.FindIndex(x => x == msgData.szDataTime); if (index < 0) { return; } if (m_timeAxisMap.Count <= MaxTimeItemCount) { JumpToTime(index); } else { //跳转时间不在最后一页中 if (index + MaxTimeItemCount < m_timeAxisMap.Count) { m_topNode = index; m_currentTimeAxisIndex = 0; m_endNode = m_topNode + MaxTimeItemCount - 1; for (int i = 0; i < m_timeAxisItemList.Count; i++) { m_timeAxisItemList[i].SetData(m_timeAxisMap[m_topNode + i], i == m_currentTimeAxisIndex); } } ///要跳转时间在最后一页中 else { m_topNode = m_timeAxisMap.Count - MaxTimeItemCount; m_currentTimeAxisIndex = index - m_topNode; m_endNode = m_timeAxisMap.Count - 1; for (int i = 0; i < m_timeAxisItemList.Count; i++) { m_timeAxisItemList[i].SetData(m_timeAxisMap[m_topNode + i], i == m_currentTimeAxisIndex); } } RefreshDataList(); } CaptureImgData img = m_ImgDataList.Find(x => x.imgInfo.nDBWarID == msgData.nDBWarID); if (img != null) { USocialShareShowMsgData imgData = new USocialShareShowMsgData(); imgData.fileIndex = index; imgData.nDBWarID = msgData.nDBWarID; imgData.imgPath = img.fileInfo.Name; imgData.imgData = img.imgByteData; OpenImgShareFrame(imgData); m_fileIndex = m_ImgDataList.IndexOf(img); } }
public void NextItem() { if (m_currentPageType == EMGloryMomentPageType.EMPage_Video) { if (m_fileIndex < 0 || m_fileIndex >= m_videoDataList.Count - 1) { return; } m_fileIndex++; if (m_videoDataList[m_fileIndex] == null) { return; } UGloryMomentVideoMsgData msgData = new UGloryMomentVideoMsgData(); msgData.nDBWarID = m_videoDataList[m_fileIndex].nDBWarID; msgData.videoPath = m_videoDataList[m_fileIndex].fileInfo.FullName; VideoPlayView.OpenView(msgData); } else if (m_currentPageType == EMGloryMomentPageType.EMPage_Image) { if (m_fileIndex < 0 || m_fileIndex >= m_ImgDataList.Count - 1) { return; } m_fileIndex++; if (m_ImgDataList[m_fileIndex] == null) { return; } USocialShareShowMsgData msgData = new USocialShareShowMsgData(); msgData.nDBWarID = m_ImgDataList[m_fileIndex].imgInfo.nDBWarID; msgData.imgPath = m_ImgDataList[m_fileIndex].fileInfo.Name; msgData.imgData = m_ImgDataList[m_fileIndex].imgByteData; ImgShareView.OpenView(msgData); } }
public void OpenView(USocialShareShowMsgData msgData) { if (msgData.imgData == null || msgData.imgPath == "") { return; } RestData(); ShareImg.gameObject.SetActive(false); nDBWarID = msgData.nDBWarID; m_fileName = msgData.imgPath; m_imgBytes = msgData.imgData; if (m_imgBytes != null) { if (shareTexture == null) { shareTexture = new Texture2D(ShareImgWidth, ShareImgHeight); } if (shareTexture != null) { shareTexture.LoadImage(m_imgBytes); if (ShareImg != null) { ShareImg.texture = shareTexture; ShareImg.gameObject.SetActive(true); } } } this.gameObject.SetActive(true); shareBar.SetData(SocialSharingType.WonderfulMoment, m_imgBytes); }
//打开图片分享 public void OpenImgShareFrame(USocialShareShowMsgData msgData) { m_fileIndex = msgData.fileIndex; ImgShareView.OpenView(msgData); }