Skip to content

Commit

Permalink
Don't allow single object upgrade from prefab editor
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute committed May 13, 2024
1 parent a738b0f commit 9c29a83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static bool ObjectsUsePrefabs(UnityEngine.Object[] objects)
if (b != null)
go = b.gameObject;
}
if (go != null && PrefabUtility.IsPartOfAnyPrefab(go))
if (go != null && (PrefabUtility.IsPartOfPrefabInstance(go) || PrefabStageUtility.GetCurrentPrefabStage() != null))
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override void OnOpen()
ux.AddChild(new TextElement()
{
text = "Unity can upgrade the objects currently being inspected, but only if none of them "
+ "are prefab instances. Undo is supported for this operation.",
+ "are prefabs or prefab instances. Undo is supported for this operation.",
style = { marginLeft = 10, marginRight = 10, marginTop = 10, marginBottom = 10, alignSelf = Align.Center }
});
var text = "Upgrade this object to " + ClassName;
Expand All @@ -94,7 +94,7 @@ public override void OnOpen()
ux.AddChild(new TextElement()
{
text = "Unity can upgrade all the Cinemachine objects in the current scene, but only if none of them "
+ "are prefab instances. Undo is supported for this operation.",
+ "are prefabs or prefab instances. Undo is supported for this operation.",
style = { marginLeft = 10, marginRight = 10, marginTop = 20, marginBottom = 10, alignSelf = Align.Center }
});
ux.AddChild(new Button(() =>
Expand Down

0 comments on commit 9c29a83

Please sign in to comment.