Hi Friends,
I’m talking about this: https://feedback.unity3d.com/suggestions/allow-access-to-sprite-packer-atlas-to-retrieve-sprites-by-name
So we could do this:
// get specific sprite by name
var sprite = myAtlas.GetSprite("oneOfTheSprites");
// or iterate them
foreach(var sprite in myAtlas)
{ /*do something*/ }
Trying to understand this request since it keeps coming up persistently. The point of a the SpritePacker is to group related textures to reduce draw calls.
Say you have AsianFurnitures tag and all your Asian style furniture go into there. In all likelihood you will render an Asian room with Asian chair, table and couch. This is efficient.
What you wouldn’t do is to group all the couches into a Couch atlas so it would contain the AsianCouch, VikingCouch, MayanCouch. By doing this, rendering the Asian room will require the CouchAtlas, TableAtlas, ChairAtlas. This is not efficient and defeats the purpose of SpritePacker.
But you might want to have a list of all couches for your in-game store so you could let the user browse through and buy the couch.
My question to you is: Do you want to iterate the list of Asian furnitures or do you want to iterate the list of all couches?
If all you want is a list of all couches for logical use, the SpritePacker is IMHO the wrong tool to help you build that list. It is really meant for optimization.
Please help me understand your needs. Thanks!