diff --git a/Assets/YooAsset/Editor/AssetArtReporter/AssetArtReporterWindow.cs b/Assets/YooAsset/Editor/AssetArtReporter/AssetArtReporterWindow.cs index e93cc543..9d651d1d 100644 --- a/Assets/YooAsset/Editor/AssetArtReporter/AssetArtReporterWindow.cs +++ b/Assets/YooAsset/Editor/AssetArtReporter/AssetArtReporterWindow.cs @@ -590,7 +590,8 @@ namespace YooAsset.Editor foreach (var selectedItem in selectedItems) { var selectElement = selectedItem as ElementTableData; - selectElement.Element.Hidden = e.newValue; + if (selectElement != null) + selectElement.Element.Hidden = e.newValue; } // 重绘视图 diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerOperationListViewer.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerOperationListViewer.cs index d01e7bff..93373cd9 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerOperationListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerOperationListViewer.cs @@ -22,7 +22,9 @@ namespace YooAsset.Editor private TableView _operationTableView; private Toolbar _bottomToolbar; +#if UNITY_2022_3_OR_NEWER private TreeView _childTreeView; +#endif private int _treeItemID = 0; private List _sourceDatas; @@ -51,9 +53,11 @@ namespace YooAsset.Editor CreateBottomToolbarHeaders(); // 子列表 +#if UNITY_2022_3_OR_NEWER _childTreeView = _root.Q("BottomTreeView"); _childTreeView.makeItem = MakeTreeViewItem; _childTreeView.bindItem = BindTreeViewItem; +#endif // 面板分屏 var topGroup = _root.Q("TopGroup"); @@ -303,8 +307,11 @@ namespace YooAsset.Editor { // 清空旧数据 _operationTableView.ClearAll(false, true); + +#if UNITY_2022_3_OR_NEWER _childTreeView.SetRootItems(new List>()); _childTreeView.Rebuild(); +#endif // 填充数据源 _sourceDatas = new List(1000); @@ -338,8 +345,10 @@ namespace YooAsset.Editor public void ClearView() { _operationTableView.ClearAll(false, true); +#if UNITY_2022_3_OR_NEWER _childTreeView.SetRootItems(new List>()); _childTreeView.Rebuild(); +#endif RebuildView(null); } @@ -371,7 +380,7 @@ namespace YooAsset.Editor _root.RemoveFromHierarchy(); } - #region 树状列表 +#if UNITY_2022_3_OR_NEWER private void OnOperationTableViewSelectionChanged(ITableData data) { var operationTableData = data as OperationTableData; @@ -508,7 +517,11 @@ namespace YooAsset.Editor } return rootItemList; } - #endregion +#else + private void OnOperationTableViewSelectionChanged(ITableData data) + { + } +#endif } } #endif \ No newline at end of file diff --git a/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleDisplay.cs b/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleDisplay.cs index 3e24ddd0..9ae8e752 100644 --- a/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleDisplay.cs +++ b/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleDisplay.cs @@ -28,11 +28,14 @@ namespace YooAsset.Editor base.SetValueWithoutNotify(newValue); RefreshIcon(); } + +#if UNITY_2021_3_OR_NEWER protected override void ToggleValue() { base.ToggleValue(); RefreshIcon(); } +#endif private void RefreshIcon() { diff --git a/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleRecord.cs b/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleRecord.cs index bb1e3b68..055ed9c2 100644 --- a/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleRecord.cs +++ b/Assets/YooAsset/Editor/UIElements/ElementsDefine/ToggleRecord.cs @@ -28,11 +28,14 @@ namespace YooAsset.Editor base.SetValueWithoutNotify(newValue); RefreshIcon(); } + +#if UNITY_2021_3_OR_NEWER protected override void ToggleValue() { base.ToggleValue(); RefreshIcon(); } +#endif private void RefreshIcon() {