From e1d2deb4c58bf07009a732d83e6e81c69e34effb Mon Sep 17 00:00:00 2001 From: Anders Ejlersen Date: Fri, 17 Dec 2021 14:02:27 +0100 Subject: [PATCH] 1.0.2: Fixed issue, where PrefabStage no longer was marked as experimental in Unity 2021 --- Editor/Toolbar/Tools/ToolUICanvasPicker.cs | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Editor/Toolbar/Tools/ToolUICanvasPicker.cs b/Editor/Toolbar/Tools/ToolUICanvasPicker.cs index 668d6a5..e0ecb2b 100644 --- a/Editor/Toolbar/Tools/ToolUICanvasPicker.cs +++ b/Editor/Toolbar/Tools/ToolUICanvasPicker.cs @@ -1,11 +1,16 @@ using System.Collections.Generic; using JetBrains.Annotations; using UnityEditor; -using UnityEditor.Experimental.SceneManagement; using UnityEditorInternal; using UnityEngine; using UTools = UnityEditor.Tools; +#if UNITY_2021_1_OR_NEWER +using UnityEditor.SceneManagement; +#else +using UnityEditor.Experimental.SceneManagement; +#endif + namespace Module.NavigationTool.Editor.Tools { [UsedImplicitly] @@ -22,7 +27,7 @@ namespace Module.NavigationTool.Editor.Tools { if (!IS_DIRTY) return; - + PrefabStage prefabStage = PrefabStageUtility.GetCurrentPrefabStage(); Canvas[] canvases = prefabStage != null ? prefabStage.prefabContentsRoot.GetComponentsInParent() : Object.FindObjectsOfType(); diff --git a/package.json b/package.json index 8e69c22..7832f05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.navigationtool", - "version": "1.0.1", + "version": "1.0.2", "displayName": "Module.NavigationTool", "description": "Support for navigation tools, like favorites, history and toolbars", "unity": "2019.2",