Example #1
0
        public void ShowBugReporter(BugReportCompleteCallback callback, bool takeScreenshotFirst = true, string descriptionText = null)
        {
            if (_isVisible)
            {
                throw new InvalidOperationException("Bug report popover is already visible.");
            }

            if (_popover == null)
            {
                Load();
            }

            if (_popover == null)
            {
                Debug.LogWarning("[SRDebugger] Bug report popover failed loading, executing callback with fail result");
                callback(false, "Resource load failed");
                return;
            }

            _callback = callback;

            _isVisible = true;
            Internal.SRDebuggerUtil.EnsureEventSystemExists();

            StartCoroutine(OpenCo(takeScreenshotFirst, descriptionText));
        }
Example #2
0
        private void OnComplete()
        {
            _isBusy = false;

            enabled = false;

            _completeCallback(_reportApi.WasSuccessful, string.IsNullOrEmpty(_reportApi.ErrorMessage) ? _errorMessage : _reportApi.ErrorMessage);

            _completeCallback = null;
        }
Example #3
0
        public void SendBugReport(BugReport report, BugReportCompleteCallback completeHandler,
                                  BugReportProgressCallback progressCallback = null)
        {
            if (report == null)
            {
                throw new ArgumentNullException("report");
            }

            if (completeHandler == null)
            {
                throw new ArgumentNullException("completeHandler");
            }

            if (_isBusy)
            {
                completeHandler(false, "BugReportApiService is already sending a bug report");
                return;
            }

            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                completeHandler(false, "No Internet Connection");
                return;
            }

            _errorMessage = "";
            enabled       = true;

            _isBusy = true;

            _completeCallback = completeHandler;
            _progressCallback = progressCallback;

            _reportApi = new BugReportApi(report, Settings.Instance.ApiKey);

            StartCoroutine(_reportApi.Submit());
        }