Unity-Technologies / guid-based-reference

A component for giving Game Objects a GUID and a class to create references to objects in any Scene by GUID
Other
625 stars 71 forks source link

Mark Scene as dirty when Guid is created. #10

Closed NuclearCookie closed 5 years ago

NuclearCookie commented 5 years ago

This is especially useful when adding a GuidComponent on an existing prefab that is already present in scenes.

This does not allow the user to undo. This is desired. A user shouldn't be able to undo the Guid generation.

Important info: After the scene loading is complete, the scene dirtyness is cleared. ->

Extra information to back up my statements:

Fixes #8

NuclearCookie commented 5 years ago

@william-w-armstrong Are you still maintaining this repository?

william-w-armstrong commented 5 years ago

I did some testing, and as far as I can tell - the Nested Prefab branch always dirties the scene when altering the GUID already. Did you have a test case where this fails?

NuclearCookie commented 5 years ago

Hi William, I'm not on the Nested-Prefab branch. Is it considered as finished?

Additionally, the Nested-Prefab branch actually records an undo for the altered guid. I don't believe it's feasible to do that, as the GUID's should always be unique. What are your thoughts?

william-w-armstrong commented 5 years ago

If you are using 18.3 or later, yes.

You are not wrong about recording Undo, but it is the only fully supported way to make changes to Nested Prefabs. If you don't record the undo operation, you don't get the nice UI showing the deltas and stuff.

NuclearCookie commented 5 years ago

Alright William, I will give the branch a try and let you know if all is working as expected.

Do you plan to merge the Nested-Prefabs into master at some point? I could give you a hand with that if you want

william-w-armstrong commented 5 years ago

Let me know if you ran into problems with the 18.3 branch - and I can reopen this.