Hello Guest

Author Topic: Sprite Collections Retina Issues  (Read 5114 times)

Babaganoosh

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Sprite Collections Retina Issues
« on: August 25, 2013, 06:16:16 pm »
Hey Dinesh,

I'm having 2 sprite collections that aren't responding to the "current platform". I set the current platform in a blank scene before the game loads, and this works for all the other sprites I have. I notice that the sprite collections are defaulting to whatever the tk2d preference menu is set at. Ie if it's set to 1x at editor, and my loading scene changes the platform to "2x" that sprite collection stays at "1x". I've tried rebuilding the 2 sprite collections multiple times, and they change platform fine when I manually set the preference menu.

These two sprite collections are in different folders than the other collections, but nothing else should be different.  Any ideas?
« Last Edit: August 27, 2013, 04:42:55 am by Babaganoosh »

Babaganoosh

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Sprite Collections Retina Issues
« Reply #1 on: August 26, 2013, 08:24:12 pm »
Bump?

Babaganoosh

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Sprite Collections Retina Issues
« Reply #2 on: August 27, 2013, 04:56:09 am »
Nvm I figured out. I use a separate script to handle the current platform setting, and it was being called after the load level mistakenly. And I guess somehow due to the order stuff awaked, some sprite collections were loading correctly and some weren't. Weird.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Collections Retina Issues
« Reply #3 on: August 27, 2013, 10:03:33 am »
Hey dude, missed your post first time around.  The sprite collection code is set up to run pretty early on, did you change the script execution order on your script to put it in front of the sprite collection stuff?

Babaganoosh

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Sprite Collections Retina Issues
« Reply #4 on: August 27, 2013, 10:42:43 am »
Nah I didn't change any script orders. I had one script which changed the current platform on Awake(). And one script which did LoadLevel() on Awake() into a scene using tk2d. How that resulted in only some collections getting affected I have no idea.

I'm assuming tk2d loads everything at once and not asynchronously.
« Last Edit: August 27, 2013, 10:45:39 am by Babaganoosh »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Collections Retina Issues
« Reply #5 on: August 27, 2013, 11:23:00 am »
tk2d loads things when Unity loads it. Its not all at once I can guarantee you that much :D
Definitely put yours in a script order, and make it run before everything. Keep your object in the root of the scene, without any prefabs and you should be more or less guaranteed it'll run before everything else.