Author Topic: (BUG)Updating atlas changes UITextures to UISprites and breaks project  (Read 1707 times)

callski

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 9
    • View Profile
I've encountered this bug multiple times in different projects. Upon updating a large atlas, the entire project gets modified. Where there once was a UITexture, the UITexture gets changed to a UISprite. The worst part about this is no error is typically output. Instead, any script referencing a UITexture with a public variable ends up referencing nothing. I have to then go through the entire project, figure out which sprites use to be a UITexture, recreate the UITexture, and reset the anchors. This waists a lot of time and makes me terrified to update an atlas. The past three projects we have worked on has had this happen without fail at some point during the development cycle...

The simple solution is to not use UITextures at all. Sadly, that's not so simple. Many of our projects are streaming and displaying images at runtime. Anyways, has anyone else encountered this issue? Any workarounds?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: (BUG)Updating atlas changes UITextures to UISprites and breaks project
« Reply #1 on: February 18, 2015, 05:39:39 PM »
Yes, this is intentional. If you created your UI with textures that then got added to an atlas, NGUI automatically replaces your textures with sprite references. Otherwise you end up duplicating texture memory by having the same data in both the texture atlas and the source textures, both of which are being used. I've answered this question many times now, and always say the same thing -- if you don't like this, disable it.

http://www.tasharen.com/forum/index.php?topic=10908.msg50893#msg50893