-
Notifications
You must be signed in to change notification settings - Fork 7
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
Prefab overrides inconsistent - leading to all components on prefabs in scenes being completely dirty #4
Comments
Hmm, I thought we serialize the global object ID of the script file here, which shouldn't change; but looks like it may be the ID of the object instead. Thanks for the report! |
We're using the global object id yes (as you can see in the string itself too) - I have seen Unity serializing different data depending on context for this before. Not sure what we can do about it - perhaps ignore it when the guid is missing (just 000000) |
hello, sorry if I'm hijacking this issue, I have more than one question if I may, I will start with one related to the issue reported here: I'm interested to know if the "$ {globalObjectId}" suffix is necessary here (at all). for instance it's not being used here thanks a lot NOTE: @hybridherbst still waiting for the UPM extensions package to be open sourced as you said in the JetBrains video 😛 |
Are you using that package instead? Does it have similar issues? Pros/cons? |
@marwie I meant we could use the GlobalObjectID of the script file instead of the object (
@HamzaRino feel free to join our discord https://discord.needle.tools, Package Tools have already been made public on our registry for everyone to use, just not open sourced yet |
yes I settled on using that one instead because I was not sure about the "$ globalObjectId" suffix also about not sure if we need all the heuristics comparisons (LevenshteinDistance for all types?)... besides the MissingReferences folder and tools here should probably belong somewhere else? |
thanks @hybridherbst |
Funny, that's the exact same issue we have and why we need a package like this. We just need to know which asmdef failed to import, then we can just reimport it from within Unity and everything will work fine again. Tried raising the issue in the unity forums but they just dismissed the issue with "the meta file must have changed" and "prove it". |
Are you able to get this information from the data written to the EditorClassIdentifier or is there something missing for you @TheXRMonk ? @HamzaRino The distance of types etc is only invoked if the script is missing AND you open the relevant foldout in the UI to try to find a matching name. There should be no performance overhead by default after writing the script information into the EditorClassIdentifier field. Let me know if you see cases where that's not the case |
Get which information? Why the id changes? |
Which asmdef failed to import |
I don't see how that's relevant. I was just confirming the need for this package because it helps with solving these issues that come up with unity sometimes. Unrelated to wether or not this package is installed. My issue as originally posted is that the EditorClassIdentifier is serialized differently based on where you inspect the component. Prefab or scene or through the ForceReserializeAssets. |
Ok great 😉 I got that |
Just published an update (1.5.1) that should prevent serializing data like reported above. |
Something still seems to be up; If I apply all the overwrites that are in my scene to the prefab, it then looks like this in git; All good - then for some reason, I have changes in my scene asset as well, so I just discard those. However, now there are new overwrites to the prefab. I then try to apply those, and this is what I get; I think I will give MissingScriptType a try instead. All I need to know is the name of the script in order to know what I'm missing and need to do to fix it. Or am I missing some essential reason for the GUID? |
I checked again why the ObjectID is being serialized: I guess this can also archieved differently (e.g. using a combination of Namespace + Class + some custom integer that we count up once) |
Just realized SolidAlloy's implementation requires custom editors. 🙃 |
Removed the usage of GlobalObjectId in 1.6.0 |
Damn you're fast! I meanwhile fixed it myself. I also extracted this functionality;
and call it like this;
I saw you made a ForceReserialize menu, which is not enough - an editor needs to be created. |
Ah ok cool, I was thinking about adding something like this earlier - we can add it as a menu item perhaps (?) About ForceSerialize: Do you think you could send an example? |
It's the thing i already posted;
The code above was just with prefabs instead. |
It might be me who's doing something wrong, since we started using ForceReserializeAssets to automatically update all our assets when we update unity, or when we pulled in this package. But it seems like different values are written to the serialized asset based on whether it's run by ForceReserializeAssets, or inspected in prefab mode, or in scene mode.
Are you able to shine some light on this issue?
The text was updated successfully, but these errors were encountered: