Exemplo n.º 1
0
 private void SetThumbnail()
 {
     //IL_001d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0022: Unknown result type (might be due to invalid IL or missing references)
     //IL_0032: Unknown result type (might be due to invalid IL or missing references)
     //IL_0038: Expected O, but got Unknown
     //IL_0059: Unknown result type (might be due to invalid IL or missing references)
     //IL_0068: Unknown result type (might be due to invalid IL or missing references)
     if (m_currentBugReport != null && !(null == m_ui))
     {
         UserReportScreenshot thumbnail = m_currentBugReport.get_Thumbnail();
         byte[]    array = Convert.FromBase64String(thumbnail.get_DataBase64());
         Texture2D val   = new Texture2D(1, 1);
         ImageConversion.LoadImage(val, array);
         Sprite thumbnail2 = Sprite.Create(val, new Rect(0f, 0f, (float)val.get_width(), (float)val.get_height()), new Vector2(0.5f, 0.5f));
         m_ui.SetThumbnail(thumbnail2);
     }
 }
 /// <summary>
 /// Takes a screenshot.
 /// </summary>
 /// <param name="maximumWidth">The maximum width.</param>
 /// <param name="maximumHeight">The maximum height.</param>
 /// <param name="source">The source. Passing null will capture the screen. Passing a camera will capture the camera's view. Passing a render texture will capture the render texture.</param>
 /// <param name="callback">The callback. Provides the screenshot.</param>
 public void TakeScreenshotFromSource(int maximumWidth, int maximumHeight, object source, Action <UserReportScreenshot> callback)
 {
     this.LogEvent(UserReportEventLevel.Info, "Taking screenshot.");
     this.screenshotsTaken++;
     this.Platform.TakeScreenshot(this.frameNumber, maximumWidth, maximumHeight, source, (passedFrameNumber, data) =>
     {
         this.synchronizedActions.Add(() =>
         {
             lock (this.screenshots)
             {
                 UserReportScreenshot userReportScreenshot = new UserReportScreenshot();
                 userReportScreenshot.FrameNumber          = passedFrameNumber;
                 userReportScreenshot.DataBase64           = Convert.ToBase64String(data);
                 this.screenshots.Add(userReportScreenshot);
                 this.screenshotsSaved++;
                 callback(userReportScreenshot);
             }
         });
     });
 }