Ejemplo n.º 1
0
        private IEnumerator SendBugReportAsync()
        {
            FeedbackFormResult result = new FeedbackFormResult();

            byte[] screenshotData = null;
            bool   isWaiting      = true;

            if (m_screenshotToggle.isOn)
            {
                yield return(StartCoroutine(CaptureScreenshot(data => screenshotData = data)));
            }

            m_loadingBox.Open("Sending bug report...");

            FeedbackForm.FeedbackType = FeedbackTypeValue;
            FeedbackForm.Email        = m_emailField.text;
            FeedbackForm.Subject      = m_subjectField.text;
            FeedbackForm.Feedback     = m_contentField.text;
            FeedbackForm.Screenshot   = screenshotData;
            FeedbackForm.SystemInfo   = PrintSystemInfo();

            FeedbackForm.Send(obj =>
            {
                result    = obj;
                isWaiting = false;
            });

            while (isWaiting)
            {
                yield return(null);
            }

            m_loadingBox.Close();

            if (result.Success)
            {
                ShowDialogBox("Your bug report has been sent! Thank you.",
                              DialogBox.ButtonLayout.OK);

                LastUsedEmail           = m_emailField.text;
                m_subjectField.text     = string.Empty;
                m_contentField.text     = string.Empty;
                m_screenshotToggle.isOn = true;
                m_systemInfoToggle.isOn = true;
            }
            else
            {
                Debug.LogError(result.Error);
                ShowDialogBox("Your bug report could not be sent! Please try again.",
                              DialogBox.ButtonLayout.OK);
            }
        }
Ejemplo n.º 2
0
        private IEnumerator SendEnhancementAsync()
        {
            FeedbackFormResult result = new FeedbackFormResult();
            bool isWaiting            = true;

            m_loadingBox.Open("Sending your feedback...");

            FeedbackForm.FeedbackType = FeedbackTypeValue;
            FeedbackForm.Email        = m_emailField.text;
            FeedbackForm.Subject      = m_subjectField.text;
            FeedbackForm.Feedback     = m_contentField.text;
            FeedbackForm.Screenshot   = null;
            FeedbackForm.SystemInfo   = PrintSystemInfo();

            FeedbackForm.Send(obj =>
            {
                result    = obj;
                isWaiting = false;
            });

            while (isWaiting)
            {
                yield return(null);
            }

            m_loadingBox.Close();

            if (result.Success)
            {
                ShowDialogBox("Your feedback has been sent! Thank you.",
                              DialogBox.ButtonLayout.OK);

                LastUsedEmail       = m_emailField.text;
                m_subjectField.text = string.Empty;
                m_contentField.text = string.Empty;
            }
            else
            {
                Debug.LogError(result.Error);
                ShowDialogBox("Your feedback could not be sent! Please try again.",
                              DialogBox.ButtonLayout.OK);
            }
        }