Author Topic: 2.5 question re: new UISprite  (Read 7571 times)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
2.5 question re: new UISprite
« on: March 24, 2013, 03:31:13 PM »
Michael, can you please provide an script or menu item for updating old sprites? Kind of concerned now that most all of my widgets are now "deprecated", and I think it will be pretty time consuming to update each and every widget to the new "regular sprite"

Quote
2.5.0
- OLD: Sliced, tiled, and filled sprites have been deprecated.
- NEW: Regular sprite now has options for how the sprite is drawn.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #1 on: March 24, 2013, 05:33:08 PM »
They update automatically when you upgrade NGUI.

It did for me, at least. :)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #2 on: March 24, 2013, 05:36:51 PM »
Thx Nicki
I usually import NGUI when in an empty scene- I thought that was the recommended way.  So you are saying for example your UISlicedSprites got changed to UISprite with Sprite Type set to Sliced? And same for the UITiledSprites and UIFilledSprites? Maybe there is some post-processing going on that I missed out on.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #3 on: March 25, 2013, 04:26:30 AM »
That's certainly what happened to me - what actually happens under the surface, I'm not really sure of, to be honest - I haven't looked closer at it. :)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #4 on: March 25, 2013, 10:23:41 AM »
Hmm, I just deleted & re-imported ngui 2.5.0c from the asset store, and none of sprites were upgraded. I still have lots of UISlicedSprite and UITiledSprite in my scene. So if there is an update mechanism I am at a loss how to trigger it.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #5 on: March 25, 2013, 11:46:09 AM »
Hmm.

Revert to the old version, then update on top of the old one, without deleting the folder. Deleting the folder can make it lose the references, if you use meta files.

silversteez

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
    • MattSilverstein.com
Re: 2.5 question re: new UISprite
« Reply #6 on: March 25, 2013, 12:42:30 PM »
oh crap... I'm also using meta files, upgraded to 2.5 the recommended way, and did a full day of UI work with the new version. All of my old slicedSprites, etc, have not been changed to the new sprite class.

There was no mention in the documentation that this upgrading process was even an option - I just assumed my old slicedSprites would stick around unless I manually upgraded them...

I grabbed a version of 2.3.4 I had on another machine and downgraded my project with it using the typical new scene, delete old NGUI folder method. Worked fine. I then re-upgraded again to 2.5 by importing directly on top of 2.3.4. All of my old slicedSprites, filledSprites have still not been moved to the new sprite class.

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #7 on: March 25, 2013, 01:19:50 PM »
The asset store does not allow downloading of old versions. Due to a recent disk upgrade, my Time Machine backup also wont allow me to fetch old version. This update process needs to be clarified, and please make a menu item and/or editor script we can run to update sprites. Thank you.

edit: I found a copy of 2.3.4-- will try what you suggested.

Hmm.

Revert to the old version, then update on top of the old one, without deleting the folder. Deleting the folder can make it lose the references, if you use meta files.
« Last Edit: March 25, 2013, 01:33:16 PM by mindlube »

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #8 on: March 25, 2013, 01:38:20 PM »
I tried reverting to 2.3.4 and updating to 2.5.0c again, and no sprites were updated, in the scene nor in the prefabs folder. 

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #9 on: March 25, 2013, 02:08:01 PM »
Strange. I guess you'll have to wait until ArenMook comes back from GDC. They changed for me, when I did it.

I will have to look into it further, but since I'm not a developer on NGUI (in spite of my moderator status) I don't honestly know all the details.

I can only imagine terribly hackish versions of fixing it, like disabling meta files temporarily while updating and reenabling after. That just leaves me feeling dirty even thinking it - it might work though.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #10 on: March 25, 2013, 02:10:08 PM »
Ps. Aren't you using some sort of version control? Subversion, git or mercurial? You really, really should so you can revert when something like this explodes.

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #11 on: March 25, 2013, 02:37:57 PM »
Nicki, OK thanks for the help.

I just tried your last suggestion: I disabled .meta files, went to blank scene, deleted NGUI folder, imported 2.3.4, then restarted Unity. Then I went to my game scene, and went to Assets | import package | Custom package and imported the 2.5.0c package file. It imports as 2.3.4 (that's the name of the readme file shown). But If I go to an new empty project and import the same 2.5.0c package file, then it imports as 2.5.0c according to the readme file.

I am using Unity 4.1.0f4. Perhaps this is a new Unity feature where it wont allow you to overwrite a package with a different version of the same package? Maybe a Unity bug even? It sure just complicates this upgrade process even more.

Thank you for the suggestion about version control. I used to use Git, but as a solo developer I have in general found that Time Machine backups seem to suit my workflow better.

Guess I will stay at 2.3.4 until the upgrade process is a little clearer. Thanks


 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #12 on: March 25, 2013, 08:42:22 PM »
NGUI keeps sliced sprites as-is. It's done so for backwards compatibility. NGUI won't change your sliced, tiled, or filled sprites to a regular UISprite, but you can no longer create new ones unless you explicitly add that script yourself.

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #13 on: March 25, 2013, 11:53:08 PM »
OK just so we know what to expect  ;) I am sure you'll put it clearly in the release notes if/when the <2.5x sprites are no longer supported.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.5 question re: new UISprite
« Reply #14 on: March 26, 2013, 03:05:41 AM »
Incidentally, don't assume it stays on the old version, just because the readme file isn't renamed - unity keeps it the same name, but the content is changed.