EmreDogann/unity-guid-reference

Revert All on prefabs causes GuidComponent to lose Guids in some cases.

Opened this issue · 0 comments

Applying "Revert All" to prefab with a removed guid component causes the guid component to be re-added, but this time with different/new guids, which is incorrect.

In theory this issue is circumvented by the SerializedGuid_Editor non-serialized fields inside GuidComponent.cs as this non-seralized field is not cleared on prefab revert or apply which means we can use this value to restore the guid that was already assigned.

However, when you remove the GuidComponent first and then click "Revert All", the ..._Editor fields are destroyed and they cannot be used to restore the guid. So as a result, the GuidComponent is reverted to it's default value, which is all Guid.Empty, and at Awake and OnValidate, it is detected that the guids are empty and assigned new guids.

Video for reference:

Unity_lUihLsAjJn.mp4