Get values from a public method

Hello everybody, I can´t figure this out, and after spending two days looking for an answer on the web, I´m out of resources, maybe someone can help me with this.
I have three UI buttons, same components:

Inside each one I call this Method from script PressedButton:

    public class PressedButton : MonoBehaviour
    {
        private string myName = "";
    
        public void ButtonName()
        {
            var nombre = EventSystem.current.currentSelectedGameObject; 
            myName = nombre.name;
    
            if (nombre != null) 
            {
                textMeshProUGUI.text = "" + myName;//... mostrarlo en el textField
//THIS SHOW IN THE TEXT FIELD ALWAYS THE RIGHT BUTTON NAME
            }
            else { return; }
        }

//here is -i think- the problem:
        public string BotonPresionado()
        {
            return myName;
        }
    }

And from script B, I try to “talk” to BotonPresionado () like this:

 void Start ()
    {
        InvokeRepeating("MainFigureChanger", 0f, 1.5f);
    }
    
    void MainFigureChanger()
    {
        QueBotonAprete();
    }    

    void QueBotonAprete()
    {
        var botonNuevo = PresssedButton.BotonPresionado();
    Debug.Log(botonNuevo);
    }

But here, no matter what, I only get a result if I click the first button (from left to right). The only way to get another name is if I disable the first button (I already try changing the z depth of the button, just in case, with no luck)

Hopefully somebody will get an idea of what may be wrong here… Thanks to all for reading!

Hi, eses, thanks for your time. What I want is to access the variable “myName” in PressedButton without making it public. So, I encapsulated it in the public method BotonPresionado().
I need BotonPresionado to return each button´s name when they´re clicked.

This is the “calling” script:

public class NewShape : MonoBehaviour {    

    PressedButton pressedButton;

    private void Awake()
    {      
        pressedButton = Object.FindObjectOfType<PressedButton>();
    }

    // Use this for initialization
    void Start ()
    {
        InvokeRepeating("MainFigureChanger", 0f, 1.5f);
    }    
    
    void MainFigureChanger()
    {
        QueBotonAprete();
    }

    void QueBotonAprete()
    {
        var botonNuevo = pressedButton.BotonPresionado();
        Debug.Log(botonNuevo);
    }
}

And in script PressedButton:

public class PressedButton : MonoBehaviour
{
    private string myName = "";

    public void ButtonName()
    {
        var nombre = EventSystem.current.currentSelectedGameObject; 
        myName = nombre.name;

        if (nombre != null) 
        {
            textMeshProUGUI.text = "" + myName;
        }


    public string BotonPresionado()
    {
        return myName;
    }
}

I don´t understand why only the first button returns it´s name from the Botonpresionado method in PressedButton… I hope this makes sense

Thanks again!