Skip to content

Commit

Permalink
fix: prefab overrides are reverted on first load of the scene at firs…
Browse files Browse the repository at this point in the history
…t launch
  • Loading branch information
anatawa12 committed Dec 19, 2024
1 parent 8897af7 commit e112d73
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public static void OnValidate<TComponent>(TComponent component,
var newCorrespondingObject = PrefabUtility.GetCorrespondingObjectFromSource(component);
if (newCorrespondingObject != null &&
PrefabUtility.GetCorrespondingObjectFromSource(newCorrespondingObject) ==
PrefabSafeUniqueCollection.CorrespondingObject)
PrefabSafeUniqueCollection.CorrespondingObject
&& !PrefabSafeUniqueCollection.IsNew) // not loading scene
{
// this might be creating prefab. we do more checks
var newCorrespondingPrefabSafeUniqueCollection = getPrefabSafeUniqueCollection(newCorrespondingObject);
Expand Down

0 comments on commit e112d73

Please sign in to comment.