diff --git a/Assets/YooAsset/Editor/AssetArtScanner/AssetArtScannerSetting.cs b/Assets/YooAsset/Editor/AssetArtScanner/AssetArtScannerSetting.cs index 128e021f..96763d41 100644 --- a/Assets/YooAsset/Editor/AssetArtScanner/AssetArtScannerSetting.cs +++ b/Assets/YooAsset/Editor/AssetArtScanner/AssetArtScannerSetting.cs @@ -32,17 +32,10 @@ namespace YooAsset.Editor // 开始扫描工作 ScanReport report = scanner.RunScanner(); - - // 检测报告合法性 report.CheckError(); - // 保存扫描结果 - string saveDirectory = scanner.SaveDirectory; - if (string.IsNullOrEmpty(saveDirectory)) - saveDirectory = "Assets/"; - string filePath = $"{saveDirectory}/{scanner.ScannerName}_{scanner.ScannerDesc}.json"; - ScanReportConfig.ExportJsonConfig(filePath, report); - return new ScannerResult(filePath, report); + // 返回扫描结果 + return new ScannerResult(report); } catch (Exception e) { diff --git a/Assets/YooAsset/Editor/AssetArtScanner/ScannerResult.cs b/Assets/YooAsset/Editor/AssetArtScanner/ScannerResult.cs index a956269c..5cf979cd 100644 --- a/Assets/YooAsset/Editor/AssetArtScanner/ScannerResult.cs +++ b/Assets/YooAsset/Editor/AssetArtScanner/ScannerResult.cs @@ -3,11 +3,6 @@ namespace YooAsset.Editor { public class ScannerResult { - /// - /// 生成的报告文件路径 - /// - public string ReprotFilePath { private set; get; } - /// /// 报告对象 /// @@ -43,11 +38,9 @@ namespace YooAsset.Editor ErrorInfo = error; ErrorStack = stack; } - public ScannerResult(string filePath, ScanReport report) + public ScannerResult(ScanReport report) { - ReprotFilePath = filePath; Report = report; - ErrorInfo = string.Empty; } /// @@ -61,5 +54,19 @@ namespace YooAsset.Editor reproterWindow.ImportSingleReprotFile(Report); } } + + /// + /// 保存报告文件 + /// + 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); + } } } \ No newline at end of file