Page 1 of 1
Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?
Posted: Wed May 29, 2019 1:28 am
by AoF
Easiest to show this with a gif:
Why does this never save?
No change there that I can see anyway:
I asked on the Unity forum and I was told:
Whatever made the changes to a Prefab needs to call various SetDirty methods but also
UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(eachComponentYouTouch)
Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?
Posted: Wed May 29, 2019 9:04 am
by Tony Li
halley is correct that when you inspect a prefab instance in a scene, a blue line on the left side of a property means it has a custom value that overrides the prefab's value. When you select Overrides > Apply All, the blue lines should disappear because it will apply those overrides to the prefab itself.
However, what she doesn't mention is that when you apply a prefab instance's overrides to a prefab, it always sets the scene dirty. If you save the scene, the '*' should disappear. (File > Save Scenes) Nothing needs to be done in a script.
Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?
Posted: Wed May 29, 2019 3:00 pm
by AoF
It's hard to see, but I actually am saving multiple times in the gif near the end. You'll notice that * on the scene name disappears and reappears. Though, I couldn't find a Save Scenes. I see a Save and a Save Project. I've tried both and after overriding and trying both, I'm still asked to override the same changes again and that feels wrong. It still says there's something to override.
I'm wondering if you can reproduce this in the project I sent you yesterday?
PS: I didn't get an email for your reply to this even though I usually do. Just thought you should know.
Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?
Posted: Wed May 29, 2019 3:28 pm
by Tony Li
AoF wrote: ↑Wed May 29, 2019 3:00 pmIt's hard to see, but I actually am saving multiple times in the gif near the end. You'll notice that * on the scene name disappears and reappears. Though, I couldn't find a Save Scenes. I see a Save and a Save Project. I've tried both and after overriding and trying both, I'm still asked to override the same changes again and that feels wrong. It still says there's something to override.
I'm wondering if you can reproduce this in the project I sent you yesterday?
Not currently, but it's a known issue in Unity that still isn't fixed in Unity 2019. If a UI element has an auto layout component of some type, such as Horizontal Layout Group or Content Size Fitter, the Rect Transform values in the scene may be slightly different from the prefab due to floating point precision.
If you're not planning to use any TextInput() sequencer commands, you can delete the Text Field UI GameObject. This will eliminate one of the possible sources of this issue, since Text Field UI has a an auto layout component.
AoF wrote: ↑Wed May 29, 2019 3:00 pmPS: I didn't get an email for your reply to this even though I usually do. Just thought you should know.
Is your spam folder trapping them now perhaps?
Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?
Posted: Wed May 29, 2019 3:31 pm
by AoF
Tony Li wrote: ↑Wed May 29, 2019 3:28 pm
Is your spam folder trapping them now perhaps?
Nope, but it turned out that I was wrong and I did receive the original email. Sorry for wasting your time on that.