how to change the sprite image code example
Example 1: change sprite of gameobject unity
gameObjectName.GetComponent().sprite = spriteName;
Example 2: load an image sprite script unity
void Start()
{
spriteArray = Resources.LoadAll("BirdHeroSprite");
}