You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/StompyRobot/SRDebugger/Scripts/UI/Tabs/BugReportTabController.cs

43 lines
1.1 KiB
C#

3 months ago
namespace SRDebugger.UI.Tabs
{
using Other;
using SRF;
using UnityEngine;
public class BugReportTabController : SRMonoBehaviourEx, IEnableTab
{
[RequiredField] public BugReportSheetController BugReportSheetPrefab;
[RequiredField] public RectTransform Container;
public bool IsEnabled
{
get { return Settings.Instance.EnableBugReporter; }
}
protected override void Start()
{
base.Start();
var sheet = SRInstantiate.Instantiate(BugReportSheetPrefab);
sheet.IsCancelButtonEnabled = false;
// Callbacks when taking screenshot will hide the debug panel so it is not present in the image
sheet.TakingScreenshot = TakingScreenshot;
sheet.ScreenshotComplete = ScreenshotComplete;
sheet.CachedTransform.SetParent(Container, false);
}
private void TakingScreenshot()
{
SRDebug.Instance.HideDebugPanel();
}
private void ScreenshotComplete()
{
SRDebug.Instance.ShowDebugPanel(false);
}
}
}