Change the material of a buttons in List and keep it by draging around the screen?

Hello dear people,

Please, i have a problem .I hope, you could help me.

I try to change the material (in image(script)) of buttons, that are saved in a public List by scripting. I have created a public list of material and add some created materials into it.
[0]: MatBlue; [1]:MatCyan

I have 2 separated buttons. What i want to do: touch a button in the list , change its material, drag the finger (and keep the pressed material of the first button, since the finger didnt leave the screen) to another button and also change its material (here, cause it would be also pressed) , and now when i release the touch, meanings remove the finger from the screen, the buttons get back to their previous respective material or colors.

I dont know know how i can check, if the button in List of buttons is pressed or not,

Please how can i achieve this by coding

Try that

I have tried it with delegates and event systems and it works now fine.
I found this video, where it is explained with examples.

Delegates and event calllbacks systems