convert image to sprite unity script code example
Example: unity set sprite image from script
Sprite myFruit = Resources.Load("fruits_1", typeof(Sprite)) as Sprite;
Sprite myFruit = Resources.Load("fruits_1", typeof(Sprite)) as Sprite;