Quantcast
Channel: Latest Questions by esitoinatteso
Viewing all articles
Browse latest Browse all 92

Reference Specific Sprites from Atlas

$
0
0
Hi guys! I know it's already been asked but, instead of helping me, the replies given to this kind of questions have confused me even more! So, I've got an Atlas sliced and inside it I've got some sprites... which are " packed". Reference/Docs specifically says that, with packed sprites, *this:* private SpriteRenderer mySP; Texture2D tex = mySP.sprite.texture; Debug.Log("TEX IS:"+tex); won't point to one Sprite but instead to the Atlas in which that one is packed along the others. ( the SpriteRenderer takes its Sprites from an Atlas) **So what would I need to do to access via code a specific Sprite inside that Atlas, aside from re-importing my sprites as single images?** I've been trying with this: List listSprite = new List(); listSprite.AddRange(Resources.LoadAll("AtlasName")); Debug.Log ("listSprite count ="+listSprite.Count); But the Count returns 0, so I guess I've missed something... Thanks for your time!

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>