diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 21387b52..704189f0 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372` ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index 6328dd6e..764bf7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372` ### Security diff --git a/Internal/PrefabSafeSet/Editor/UniqueCollection/PrefabSafeUniqueCollectionRuntimeEditorImpl.cs b/Internal/PrefabSafeSet/Editor/UniqueCollection/PrefabSafeUniqueCollectionRuntimeEditorImpl.cs index 033c04c5..39eb1e64 100644 --- a/Internal/PrefabSafeSet/Editor/UniqueCollection/PrefabSafeUniqueCollectionRuntimeEditorImpl.cs +++ b/Internal/PrefabSafeSet/Editor/UniqueCollection/PrefabSafeUniqueCollectionRuntimeEditorImpl.cs @@ -39,7 +39,8 @@ public static void OnValidate(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);