BugReportTabController.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using SRDebugger.UI.Other;
  3. using SRF;
  4. using UnityEngine;
  5. namespace SRDebugger.UI.Tabs
  6. {
  7. public class BugReportTabController : SRMonoBehaviourEx, IEnableTab
  8. {
  9. public bool IsEnabled
  10. {
  11. get
  12. {
  13. return Settings.Instance.EnableBugReporter;
  14. }
  15. }
  16. protected override void Start()
  17. {
  18. base.Start();
  19. BugReportSheetController bugReportSheetController = SRInstantiate.Instantiate<BugReportSheetController>(this.BugReportSheetPrefab);
  20. bugReportSheetController.IsCancelButtonEnabled = false;
  21. bugReportSheetController.TakingScreenshot = new Action(this.TakingScreenshot);
  22. bugReportSheetController.ScreenshotComplete = new Action(this.ScreenshotComplete);
  23. bugReportSheetController.CachedTransform.SetParent(this.Container, false);
  24. }
  25. private void TakingScreenshot()
  26. {
  27. SRDebug.Instance.HideDebugPanel();
  28. }
  29. private void ScreenshotComplete()
  30. {
  31. SRDebug.Instance.ShowDebugPanel(false);
  32. }
  33. [RequiredField]
  34. public BugReportSheetController BugReportSheetPrefab;
  35. [RequiredField]
  36. public RectTransform Container;
  37. }
  38. }