Get Material from static mesh

Hi all!

I’m trying to create a basic menu:

One button to identify all the hotel elements in my file and change the material when clicked:

I achieved this.

But then I have another button to reset all materials to the original.

Also I can do that.

But the problem comes now. because when I click again the first button to identify the hotels I need to click twice to get the colour.

My question is:

On the first button how can I call the static mesh and identify which material has and then depending on the answer I can change to one or another?

Hope this makes sense.

Thanks all