diff --git a/com.unity.cinemachine/Editor/Upgrader/CinemachineUpgradeManager.cs b/com.unity.cinemachine/Editor/Upgrader/CinemachineUpgradeManager.cs index bea6599fb..be1816803 100644 --- a/com.unity.cinemachine/Editor/Upgrader/CinemachineUpgradeManager.cs +++ b/com.unity.cinemachine/Editor/Upgrader/CinemachineUpgradeManager.cs @@ -178,7 +178,7 @@ public static bool ObjectsUsePrefabs(UnityEngine.Object[] objects) if (b != null) go = b.gameObject; } - if (go != null && (PrefabUtility.IsPartOfPrefabInstance(go) || PrefabStageUtility.GetCurrentPrefabStage() != null)) + if (go != null && PrefabUtility.IsPartOfPrefabInstance(go) || PrefabUtility.IsPartOfPrefabAsset(go)) return true; } return false; diff --git a/com.unity.cinemachine/Editor/Upgrader/UpgradeManagerInspectorHelpers.cs b/com.unity.cinemachine/Editor/Upgrader/UpgradeManagerInspectorHelpers.cs index 0cbe04920..d152b0b35 100644 --- a/com.unity.cinemachine/Editor/Upgrader/UpgradeManagerInspectorHelpers.cs +++ b/com.unity.cinemachine/Editor/Upgrader/UpgradeManagerInspectorHelpers.cs @@ -3,6 +3,7 @@ using UnityEditor; using System; using UnityEngine.UIElements; +using UnityEditor.SceneManagement; namespace Unity.Cinemachine.Editor { @@ -88,7 +89,7 @@ public override void OnOpen() }) { text = text, style = { flexGrow = 0, alignSelf = Align.Center } - }).SetEnabled(!CinemachineUpgradeManager.ObjectsUsePrefabs(Editor.targets)); + }).SetEnabled(PrefabStageUtility.GetCurrentPrefabStage() == null && !CinemachineUpgradeManager.ObjectsUsePrefabs(Editor.targets)); // Upgrade current scene ux.AddChild(new TextElement() @@ -105,7 +106,7 @@ public override void OnOpen() }) { text = "Upgrade all objects in Scene", style = { flexGrow = 0, alignSelf = Align.Center } - }).SetEnabled(!CinemachineUpgradeManager.CurrentSceneUsesPrefabs()); + }).SetEnabled(PrefabStageUtility.GetCurrentPrefabStage() == null && !CinemachineUpgradeManager.CurrentSceneUsesPrefabs()); // Upgrade project ux.AddChild(new TextElement()