public void Clear() { szShareImgPath = ""; szShareImgUrl = ""; shareImgData = null; nBtnSelectedIndex = -1; m_SharePlatform = EMSocialSharePlatform.EMSSP_None; m_shareType = SocialSharingType.TypeMax; BtnBorderTransform.gameObject.SetActive(false); CloseWeChatFrame(); StopAllCoroutines(); if (bDownLoadQR) { Destroy(QRImg.texture); QRImg.texture = null; bDownLoadQR = false; } bInit = false; }
/// <summary> /// 初始化数据,参数传分享类型+图片数据 /// </summary> /// <param name="sharingType"></param> /// <param name="imgBytes"></param> public void SetData(SocialSharingType sharingType, byte[] imgBytes = null) { Clear(); if (null == imgBytes) { return; } shareImgData = imgBytes; m_shareType = sharingType; bInit = true; }
/// <summary> /// 初始化数据,参数传分享类型+图片全路径 /// </summary> /// <param name="sharingType"></param> /// <param name="imgFullPath"></param> public void SetData(SocialSharingType sharingType, string imgFullPath = "") { Clear(); if (imgFullPath == "") { return; } szShareImgPath = imgFullPath; m_shareType = sharingType; bInit = true; }
private void AddNode(SocialSharingType type, string title, string desc) { List <SocialSharingNode> nodeList; if (!m_dicSocialSharingNodeList.TryGetValue(type, out nodeList)) { nodeList = new List <SocialSharingNode>(); m_dicSocialSharingNodeList.Add(type, nodeList); } int nIndex = nodeList.Count; SocialSharingNode node = new SocialSharingNode(nIndex, title, desc); nodeList.Add(node); }
public SocialSharingNode RandomSharingNode(SocialSharingType type) { if (!m_dicSocialSharingNodeList.ContainsKey(type)) { return(null); } List <SocialSharingNode> nodeList = m_dicSocialSharingNodeList[type]; if (null == nodeList || nodeList.Count < 1) { return(null); } Random random = new Random(); int index = random.Next(0, nodeList.Count); return(nodeList[index]); }