All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 3s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 10s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 1m25s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 4s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 4s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s
72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
|
|
namespace YooAsset.Editor
|
|
{
|
|
public class ScannerResult
|
|
{
|
|
/// <summary>
|
|
/// 报告对象
|
|
/// </summary>
|
|
public ScanReport Report { private set; get; }
|
|
|
|
/// <summary>
|
|
/// 错误信息
|
|
/// </summary>
|
|
public string ErrorInfo { private set; get; }
|
|
|
|
/// <summary>
|
|
/// 错误堆栈
|
|
/// </summary>
|
|
public string ErrorStack { private set; get; }
|
|
|
|
/// <summary>
|
|
/// 是否成功
|
|
/// </summary>
|
|
public bool Succeed
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(ErrorInfo))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
public ScannerResult(string error, string stack)
|
|
{
|
|
ErrorInfo = error;
|
|
ErrorStack = stack;
|
|
}
|
|
public ScannerResult(ScanReport report)
|
|
{
|
|
Report = report;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打开报告窗口
|
|
/// </summary>
|
|
public void OpenReportWindow()
|
|
{
|
|
if (Succeed)
|
|
{
|
|
var reproterWindow = AssetArtReporterWindow.OpenWindow();
|
|
reproterWindow.ImportSingleReprotFile(Report);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存报告文件
|
|
/// </summary>
|
|
public void SaveReportFile(string saveDirectory)
|
|
{
|
|
if (Report == null)
|
|
throw new System.Exception("Scan report is invalid !");
|
|
|
|
if (string.IsNullOrEmpty(saveDirectory))
|
|
saveDirectory = "Assets/";
|
|
string filePath = $"{saveDirectory}/{Report.ReportName}_{Report.ReportDesc}.json";
|
|
ScanReportConfig.ExportJsonConfig(filePath, Report);
|
|
}
|
|
}
|
|
} |