change image property of a gameobject unity code example
Example 1: load an image sprite script unity
void Start()
{
spriteArray = Resources.LoadAll<Sprite>("BirdHeroSprite");
}
Example 2: unity c# change image source
Image[] images = PlayerBarExample.GetComponentsInChildren<Image>(); Image face = images[0]; foreach (Image image in images) { if (image.gameObject.CompareTag("face")) face = image; }