how to change sprite using script unity 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");
}