Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EmreDogann opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@EmreDogann
Copy link
Owner

EmreDogann commented Apr 30, 2024

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
@EmreDogann EmreDogann added bug Something isn't working help wanted Extra attention is needed labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant