unity load sprite from sprite library assets code example
Example: load an image sprite script unity
void Start()
{
spriteArray = Resources.LoadAll<Sprite>("BirdHeroSprite");
}
void Start()
{
spriteArray = Resources.LoadAll<Sprite>("BirdHeroSprite");
}