unity C# how to make an image = to a sprite in code code example
Example 1: change sprite of gameobject unity
gameObjectName.GetComponent().sprite = spriteName;
Example 2: sprite unity script
Resources.Load
gameObjectName.GetComponent().sprite = spriteName;
Resources.Load