Author Topic: Prefabs "resetting" when hitting Apply  (Read 7298 times)

niall

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 13
    • View Profile
Prefabs "resetting" when hitting Apply
« 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?
« Last Edit: July 29, 2014, 08:14:01 AM by niall »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #1 on: July 30, 2014, 09:31:15 AM »
I'd need repro steps to follow if you're on the latest NGUI.

RobBrooks

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #2 on: July 30, 2014, 09:59:49 AM »

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

Was this fixed ArenMook?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #3 on: July 30, 2014, 10:58:39 AM »
A long time ago, yeah.

niall

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #4 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! 

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #5 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

andreyd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: Prefabs "resetting" when hitting Apply
« Reply #6 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.