unity set sprite to image file from script code example
Example: load an image sprite script unity
void Start()
{
spriteArray = Resources.LoadAll("BirdHeroSprite");
}
void Start()
{
spriteArray = Resources.LoadAll("BirdHeroSprite");
}