#if UNITY_2019_4_OR_NEWER using System; using System.IO; using System.Linq; using System.Collections.Generic; using UnityEditor; using UnityEngine; using UnityEditor.UIElements; using UnityEngine.UIElements; namespace YooAsset.Editor { public class AssetArtReporterWindow : EditorWindow { [MenuItem("YooAsset/AssetArt Reporter", false, 302)] public static AssetArtReporterWindow OpenWindow() { AssetArtReporterWindow window = GetWindow("AssetArt Reporter", true, WindowsDefine.DockedWindowTypes); window.minSize = new Vector2(800, 600); return window; } private class ElementTableData : DefaultTableData { public ReportElement Element; } private class PassesBtnCell : ITableCell, IComparable { public object CellValue { set; get; } public string SearchTag { private set; get; } public ReportElement Element { get { return (ReportElement)CellValue; } } public PassesBtnCell(string searchTag, ReportElement element) { SearchTag = searchTag; CellValue = element; } public object GetDisplayObject() { return string.Empty; } public int CompareTo(object other) { if (other is PassesBtnCell cell) { return this.Element.Passes.CompareTo(cell.Element.Passes); } else { return 0; } } } private class WhiteListBtnCell : ITableCell, IComparable { public object CellValue { set; get; } public string SearchTag { private set; get; } public ReportElement Element { get { return (ReportElement)CellValue; } } public WhiteListBtnCell(string searchTag, ReportElement element) { SearchTag = searchTag; CellValue = element; } public object GetDisplayObject() { return string.Empty; } public int CompareTo(object other) { if (other is WhiteListBtnCell cell) { return this.Element.IsWhiteList.CompareTo(cell.Element.IsWhiteList); } else { return 0; } } } private ToolbarSearchField _searchField; private Button _showHiddenBtn; private Button _whiteListVisibleBtn; private Button _passesVisibleBtn; private Label _titleLabel; private Label _descLabel; private TableView _elementTableView; private ScanReportCombiner _reportCombiner; private string _lastestOpenFolder; private List _sourceDatas; private bool _elementVisibleState = true; private bool _whiteListVisibleState = true; private bool _passesVisibleState = true; public void CreateGUI() { try { VisualElement root = this.rootVisualElement; // 加载布局文件 var visualAsset = UxmlLoader.LoadWindowUXML(); if (visualAsset == null) return; visualAsset.CloneTree(root); // 导入按钮 var importSingleBtn = root.Q