From dfb85416053f1afe588b2576f92254c118229a1c Mon Sep 17 00:00:00 2001 From: yasirkula Date: Sun, 24 Apr 2022 15:14:47 +0300 Subject: [PATCH] Fixed compiler errors on 2021.2 and later --- Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs | 2 +- .../AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs | 5 ++++- Plugins/AssetUsageDetector/Editor/SearchResultTreeView.cs | 5 ++++- Plugins/AssetUsageDetector/Editor/Utilities.cs | 2 +- package.json | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs b/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs index 749b2f6..417ac6e 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs @@ -10,7 +10,7 @@ using System; using System.IO; using System.Text; using Object = UnityEngine.Object; -#if UNITY_2018_3_OR_NEWER +#if UNITY_2018_3_OR_NEWER && !UNITY_2021_2_OR_NEWER using PrefabStage = UnityEditor.Experimental.SceneManagement.PrefabStage; using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility; #endif diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs index aa601a3..85501b8 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs @@ -5,7 +5,10 @@ using UnityEditor; using System.Collections.Generic; using System.Reflection; using Object = UnityEngine.Object; -#if UNITY_2018_3_OR_NEWER +#if UNITY_2021_2_OR_NEWER +using PrefabStage = UnityEditor.SceneManagement.PrefabStage; +using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility; +#elif UNITY_2018_3_OR_NEWER using PrefabStage = UnityEditor.Experimental.SceneManagement.PrefabStage; using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility; #endif diff --git a/Plugins/AssetUsageDetector/Editor/SearchResultTreeView.cs b/Plugins/AssetUsageDetector/Editor/SearchResultTreeView.cs index 6f6c364..af48a89 100644 --- a/Plugins/AssetUsageDetector/Editor/SearchResultTreeView.cs +++ b/Plugins/AssetUsageDetector/Editor/SearchResultTreeView.cs @@ -5,7 +5,10 @@ using System.Text; using UnityEditor; using UnityEditor.IMGUI.Controls; using UnityEngine; -#if UNITY_2018_3_OR_NEWER +#if UNITY_2021_2_OR_NEWER +using PrefabStage = UnityEditor.SceneManagement.PrefabStage; +using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility; +#elif UNITY_2018_3_OR_NEWER using PrefabStage = UnityEditor.Experimental.SceneManagement.PrefabStage; using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility; #endif diff --git a/Plugins/AssetUsageDetector/Editor/Utilities.cs b/Plugins/AssetUsageDetector/Editor/Utilities.cs index 8e44899..089de22 100644 --- a/Plugins/AssetUsageDetector/Editor/Utilities.cs +++ b/Plugins/AssetUsageDetector/Editor/Utilities.cs @@ -10,7 +10,7 @@ using UnityEditor.SceneManagement; using UnityEngine; using UnityEngine.SceneManagement; using Object = UnityEngine.Object; -#if UNITY_2018_3_OR_NEWER +#if UNITY_2018_3_OR_NEWER && !UNITY_2021_2_OR_NEWER using PrefabStage = UnityEditor.Experimental.SceneManagement.PrefabStage; using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility; #endif diff --git a/package.json b/package.json index c394108..7732e81 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.yasirkula.assetusagedetector", "displayName": "Asset Usage Detector", - "version": "2.2.0", + "version": "2.2.1", "documentationUrl": "https://github.com/yasirkula/UnityAssetUsageDetector", "changelogUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/releases", "licensesUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/blob/master/LICENSE.txt",