Need Image in UI canvas to change depending on variable

So I’ve been using

public Text text1;

to change the text on a button in the UI for my game according to a variable,
now I need to do the same but for an image or image source on the same UI

so I’m looking for something like

public Image image1;

image1(?) = (?)

OR if you have a better Idea let me know.

canvas.

use a switch statement that switch’s by what is in your text1 string.

sorry for the layout my browsers doing weired things will fix it when I get home.

public void whatever your public void is on your buttons()
{
Switch(text1.text)
{
case “Kick”:
change image here

break;

case “Button”
change image here

break;

}
}

don’t know exactly what your wanting or how your scripts set up so sorry if this isn’t what your wanting

SO I guess more specifically is I have a system set up to generate creatures pokemon style, they have a state sheet like

Name: (name)
Class Image: (image) <-( I wanna to set a method that will make the currentSprite or currentImage this and loads it into the battle screen)
Attack: (value)
etc