Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: niall on July 29, 2014, 07:27:14 AM

Title: Prefabs "resetting" when hitting Apply
Post by: niall on July 29, 2014, 07:27:14 AM
I'm making my NGUI UI out of various prefabbed panels.  I have always just duplicated a previous panel and used that to start on the next one.  Now however, I have to create new panels, sprites, and buttons from scratch because of an odd prefab issue.  If I duplicate prefab-1 and rename it prefab-2, then make various changes that break the prefab connection in the process.  Then I drag prefab-2 into my Resources folder to ensure it becomes a "new" prefab, right?  Well both that drag and drop, and any subsequent clicks on the Apply button for that prefab will reset any sprite associations on the child GameObjects.  (edit: I should mention that the sprites are reset to their old sprites from prefab-1)  Their sizing and positioning changes remain intact, just the sprite graphic itself reverts to what it was on prefab-1.  Any ideas?
Title: Re: Prefabs "resetting" when hitting Apply
Post by: ArenMook on July 30, 2014, 09:31:15 AM
I'd need repro steps to follow if you're on the latest NGUI.
Title: Re: Prefabs "resetting" when hitting Apply
Post by: RobBrooks on July 30, 2014, 09:59:49 AM

Is this the old 'Disable Button Component Before Applying' feature?

Was this fixed ArenMook?
Title: Re: Prefabs "resetting" when hitting Apply
Post by: ArenMook on July 30, 2014, 10:58:39 AM
A long time ago, yeah.
Title: Re: Prefabs "resetting" when hitting Apply
Post by: niall on July 30, 2014, 11:48:12 AM
I'm using NGUI 3.6.0, haven't kept up on any updates in a month or so, but I think it's still fairly new?? 

It would take me a while to try and repro from scratch vs just using the current prefabs I have, but I'll try to get that soon! 
Title: Re: Prefabs "resetting" when hitting Apply
Post by: beermoney on July 30, 2014, 03:06:03 PM
I've seen something similar when I've used prefabs as children of prefabs (trying to recycle!), to fix it I ended up adding the prefab to the scene, breaking prefab connection, deleting the old prefab and creating a new prefab from the object in the scene
Title: Re: Prefabs "resetting" when hitting Apply
Post by: andreyd on July 31, 2014, 10:05:22 AM
Yep, this is definitely a nested prefab issue. We have been trying to avoid nested prefabs as it's very prone to human error. Depending on where in the hierarchy you hit "Apply" your changes will be overwritten.