-
Notifications
You must be signed in to change notification settings - Fork 122
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
Scene file changes in version 3 #24
Comments
The expected behaviour is that when we change components, it changes in scene file, but not when we change material manually. Unfortunately I am not into Unity anymore and, if you have some issues and able to fix it with PR, I will be really appreciate! |
Sorry, to clarify, I haven't changed any settings into the Components, I'm just seeing the same ever-changing values that were happening in the Material files, now happening in my Scene file. I was wondering if that was expected, or if the changing-numbers problem still exists, but was just moved somewhere else. (I can try and look into it.) |
@russellquinn I can't seem to reproduce it. Does this happen every time you save the scene? When you look at the diff, does it show any changed objects other than the material? |
It happens every time I make a change to something (so the scene is dirty) and then save. For example, change the name of a single, unrelated GameObject in the scene and save. From looking at the code, I think the problem is that it creates a dynamic material and sets the Image's Material property to be this material. This causes the Material to be saved to the Scene file. But, it recreates this Material every single time Unity is run. |
I spent some time refactoring and trying to get more-stable changes. You can see my progress here: russellquinn@3c508c9 But, I ran into a problem with being unable to update the dynamic material if "Is Maskable" is set on the image. I switched back to version 3.0.1 and I think it suffers from the same problem — the new system breaks if maskable is set. Or, at least, the dynamic updating breaks. |
This update seems to have caused more problems than it was supposed to solve. Anyway, I've been able to reproduce the material being recreated by closing the scene, then opening it again and saving it. I didn't test it but your refactoring should help here. Also, I think maybe we don't need to store the material in our script at all, since the Image holds a reference to it, so I wonder why masks were affected though. |
Masks change the material used by the Image to a stencil material |
A summary of the problems:
|
Since version 3 implemented dynamic Material creation, we've fixed the problem of floating-point values in Material asset files changing and making for confusing source-control commits.
But, now I'm seeing lots of spurious changes in my Scene files. Material components being added and/or deleted from GameObjects. This makes it very hard to check any intended changes in scene files while committing to source control.
Is this an expected result of the new system, or is it because I switched from version 2 to 3 on an existing project, and Unity is only updating GameObjects to the new dynamic-Material system when I touch them during editing?
The text was updated successfully, but these errors were encountered: