ScannerResult.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. 
  2. namespace YooAsset.Editor
  3. {
  4. public class ScannerResult
  5. {
  6. /// <summary>
  7. /// 生成的报告文件路径
  8. /// </summary>
  9. public string ReprotFilePath { private set; get; }
  10. /// <summary>
  11. /// 报告对象
  12. /// </summary>
  13. public ScanReport Report { private set; get; }
  14. /// <summary>
  15. /// 错误信息
  16. /// </summary>
  17. public string ErrorInfo { private set; get; }
  18. /// <summary>
  19. /// 是否成功
  20. /// </summary>
  21. public bool Succeed
  22. {
  23. get
  24. {
  25. if (string.IsNullOrEmpty(ErrorInfo))
  26. return true;
  27. else
  28. return false;
  29. }
  30. }
  31. public ScannerResult(string error)
  32. {
  33. ErrorInfo = error;
  34. }
  35. public ScannerResult(string filePath, ScanReport report)
  36. {
  37. ReprotFilePath = filePath;
  38. Report = report;
  39. ErrorInfo = string.Empty;
  40. }
  41. /// <summary>
  42. /// 打开报告窗口
  43. /// </summary>
  44. public void OpenReportWindow()
  45. {
  46. if (Succeed)
  47. {
  48. var reproterWindow = AssetArtReporterWindow.OpenWindow();
  49. reproterWindow.ImportSingleReprotFile(ReprotFilePath);
  50. }
  51. }
  52. }
  53. }