From c4ae67aa8eec0726680c7639bc43e9803f1feb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=86=A0=E5=B3=B0?= Date: Tue, 23 Sep 2025 11:08:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=B5=84=E6=BA=90=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=B8=BB=E5=8A=A8=E7=94=9F=E6=88=90=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetArtScanner/AssetArtScannerSetting.cs | 11 ++------- .../Editor/AssetArtScanner/ScannerResult.cs | 23 ++++++++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) 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