Skip to content

Commit a319170

Browse files
committed
Update PrefabStageUtility's new namespace
1 parent b199b34 commit a319170

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Assets/MRTK/Core/Inspectors/Utilities/InspectorUIUtility.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,11 @@ static public bool DrawScriptableFoldout<T>(SerializedProperty scriptable, strin
650650
else
651651
{
652652
bool isNestedInCurrentPrefab = false;
653-
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage();
653+
#if UNITY_2021_2_OR_NEWER
654+
var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
655+
#else
656+
var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
657+
#endif
654658
if (prefabStage != null)
655659
{
656660
var instancePath = AssetDatabase.GetAssetPath(scriptable.objectReferenceValue);

Assets/MRTK/Core/Utilities/Scenes/EditorSceneUtils.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ public static IEnumerable<GameObject> GetRootGameObjectsInLoadedScenes()
253253
/// </summary>
254254
public static bool IsEditingPrefab()
255255
{
256+
#if UNITY_2021_2_OR_NEWER
257+
var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
258+
#else
256259
var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
260+
#endif
257261
return prefabStage != null;
258262
}
259263

0 commit comments

Comments
 (0)