image to sprite script unity code example
Example 1: change sprite of a sprite unity
public SpriteRenderer spriteRenderer;
public Sprite newSprite;
void ChangeSprite()
{
spriteRenderer.sprite = newSprite;
}
Example 2: image.sprite unity
Image1.sprite =new Sprite;