private IEnumerator ShareCoroutine()
        {
#if UNITY_EDITOR || UNITY_STANDALONE
            var path = "ScreenShot.png";
#else
            var path = Application.persistentDataPath + "/ScreenShot.png";
#endif

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            ScreenCapture.CaptureScreenshot("ScreenShot.png");

            while (!File.Exists(path))
            {
                yield return(new WaitForSeconds(0.1f));
            }

            yield return(new WaitForSeconds(0.5f));

            _wechatManager.WxCircle(null, null, path, null, null, null,
                                    null);
            _analyticManager.Event("raceAward_wx_share");

            _sharing = false;
            Hide();
            ShowGetAwardDialog();
        }
示例#2
0
        /// <summary>
        /// 去完成
        /// </summary>
        public void GoToTask()
        {
            if (_data == null)
            {
                return;
            }

            var action   = _data.extra_action;
            var taskCode = _data.task_code;

            if (action == null)
            {
                return;
            }

            UserTaskDialog.Hide();

            switch (action.type)
            {
            case ExtraActionType.SHOW_DIALOG:
                _dialogManager.ShowDialog <UIWindow>(action.dialog_name);
                break;

            case ExtraActionType.AWARD:
                _remoteApi.RequestAward(action.award_type, action.award_code);
                break;

            case ExtraActionType.GOTO_ROOM:
                _remoteApi.ChooseRoom((int)action.room_id);
                break;

            case ExtraActionType.WE_CHAT_SHARE:
                var shareContent = new ShareContent(ShareResultType.TaskCode, taskCode);
                var content      = JsonUtility.ToJson(shareContent);
                if (action.wx_share_type == WxShareType.WxShare)
                {
                    _weChatManager.WxShare(action.wx_url, action.wx_img_url, null, action.wx_title,
                                           action.wx_content,
                                           action.wx_thumb_url, content);
                }
                else if (action.wx_share_type == WxShareType.WxCircle)
                {
                    _weChatManager.WxCircle(action.wx_url, action.wx_img_url, null, action.wx_title,
                                            action.wx_content,
                                            action.wx_thumb_url, content);
                }

                break;

            default: break;
            }
        }
示例#3
0
        public void DoShare(bool circle)
        {
            if (circle)
            {
                _weChatManager.WxCircle(_url, _imgUrl, _imgPath, _title, _content, _thumbUrl, _awardCode);
            }
            else
            {
                _weChatManager.WxShare(_url, _imgUrl, _imgPath, _title, _content, _thumbUrl, _awardCode);
            }

            Hide();
        }