From 02250c3352c0dc8e4f6f8fdd0aa1e6a613bb9a06 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Nov 2024 14:40:49 +0800 Subject: [PATCH] upgrade deprecated method in newer version --- .../AssetBundleCollector/AssetBundleCollectorWindow.cs | 8 ++++++-- .../VisualViewers/DebuggerAssetListViewer.cs | 4 +++- .../VisualViewers/DebuggerBundleListViewer.cs | 4 +++- .../VisualViewers/ReporterAssetListViewer.cs | 4 +++- .../VisualViewers/ReporterBundleListViewer.cs | 4 +++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs index f469172..b5bcc87 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs @@ -205,7 +205,9 @@ namespace YooAsset.Editor _packageListView = root.Q("PackageListView"); _packageListView.makeItem = MakePackageListViewItem; _packageListView.bindItem = BindPackageListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _packageListView.selectionChanged += PackageListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _packageListView.onSelectionChange += PackageListView_onSelectionChange; #else _packageListView.onSelectionChanged += PackageListView_onSelectionChange; @@ -250,7 +252,9 @@ namespace YooAsset.Editor _groupListView = root.Q("GroupListView"); _groupListView.makeItem = MakeGroupListViewItem; _groupListView.bindItem = BindGroupListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _groupListView.selectionChanged += GroupListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _groupListView.onSelectionChange += GroupListView_onSelectionChange; #else _groupListView.onSelectionChanged += GroupListView_onSelectionChange; diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs index 9765b59..674884f 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs @@ -35,7 +35,9 @@ namespace YooAsset.Editor _assetListView = _root.Q("TopListView"); _assetListView.makeItem = MakeAssetListViewItem; _assetListView.bindItem = BindAssetListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _assetListView.selectionChanged += AssetListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _assetListView.onSelectionChange += AssetListView_onSelectionChange; #else _assetListView.onSelectionChanged += AssetListView_onSelectionChange; diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerBundleListViewer.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerBundleListViewer.cs index 953ae61..8966a25 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerBundleListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerBundleListViewer.cs @@ -35,7 +35,9 @@ namespace YooAsset.Editor _bundleListView = _root.Q("TopListView"); _bundleListView.makeItem = MakeBundleListViewItem; _bundleListView.bindItem = BindBundleListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _bundleListView.selectionChanged += BundleListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _bundleListView.onSelectionChange += BundleListView_onSelectionChange; #else _bundleListView.onSelectionChanged += BundleListView_onSelectionChange; diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterAssetListViewer.cs b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterAssetListViewer.cs index 912a302..f59e884 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterAssetListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterAssetListViewer.cs @@ -58,7 +58,9 @@ namespace YooAsset.Editor _assetListView = _root.Q("TopListView"); _assetListView.makeItem = MakeAssetListViewItem; _assetListView.bindItem = BindAssetListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _assetListView.selectionChanged += AssetListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _assetListView.onSelectionChange += AssetListView_onSelectionChange; #else _assetListView.onSelectionChanged += AssetListView_onSelectionChange; diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterBundleListViewer.cs b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterBundleListViewer.cs index 78bfe24..d82faaa 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterBundleListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterBundleListViewer.cs @@ -66,7 +66,9 @@ namespace YooAsset.Editor _bundleListView = _root.Q("TopListView"); _bundleListView.makeItem = MakeBundleListViewItem; _bundleListView.bindItem = BindBundleListViewItem; -#if UNITY_2020_1_OR_NEWER +#if UNITY_2022_3_OR_NEWER + _bundleListView.selectionChanged += BundleListView_onSelectionChange; +#elif UNITY_2020_1_OR_NEWER _bundleListView.onSelectionChange += BundleListView_onSelectionChange; #else _bundleListView.onSelectionChanged += BundleListView_onSelectionChange;