UI button class


I have a scene with a map like candy rush, all the buttons load a different level, the buttons works in the same way:

When the level is locked I want to use a given sprite, when the level is not locked I want to use another sprite.

Ideally I am thinking of creating that script that is reading the variables and deciding which sprite to use, dragging that script on my button and that’s it.

But how do I select the button on which the script is on?
thanks for any advice!

I tried that using


but no results!