So I have 100 items, they are images, they all have the same Packing Tag.
I also have a menu and when you select something from it, it will set the Sprite component on a button. Now I can do this:
button.GetComponent().sprite = Resources.Load(“images/items/imageName”);
But I think that loads the source image rather than creating an instance from the texture atlas. Or does it? I’m not sure. Loading individual images will end up in loads of draw calls so I want to avoid that.
Does anyone know the correct way to set the sprite using just code?