Author Topic: UIAtlas Request  (Read 3700 times)

joreldraw

  • Guest
UIAtlas Request
« on: June 28, 2012, 06:00:42 AM »
Hi , im optimising my Atlas now i have all sprites i need and now im in need to search what elements are using specific sprite.

Exist a way to do now this?
If not i think is a pretty Request to add a filter on UIAtlas Inspector to do this.

Thx

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas Request
« Reply #1 on: June 28, 2012, 07:16:38 AM »
What elements are using a specific sprite? What do you mean by elements? You mean UISprites? You can just iterate through the list of your sprites and check their spriteName against the one you're expecting to find.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UIAtlas Request
« Reply #2 on: June 28, 2012, 07:19:35 AM »
Do a custom editor script that sets up an int for each sprite in your atlas and run through all your widgets and add up for each that use that sprite. If any is 0 at the end, you can (carefully) remove the sprite from the atlas if you want.

Do note that if you set them by code, this won't work, so you'll have to get more clever and do it in playmode and go through all (ALL) your screens and do the same.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas Request
« Reply #3 on: June 28, 2012, 07:20:59 AM »
This also won't cover prefabs, or other scenes.