How do i change button On Click() passing parameter from script

How do i change On Click() parameter from script in c#
See image:
129055-untitled-1.png

You can’t change the callbacks you have specified in the editor through a script. You have to do the whole job in the script.

public Button Button;
public UIController UIController;
private UnityEngine.Events.UnityAction buttonCallback;

private void AddAvatarCallback()
{
    // Remove the last added callback
    if( buttonCallback != null )
        Button.onClick.RemoveListener( buttonCallback );

    // Define new callback
    if( /* some condition */ )
        buttonCallback = () => UIController.OnClick_ShowAvatar( "My avatar #1" );
    if( /* some other condition */ )
        buttonCallback = () => UIController.OnClick_ShowAvatar( "My avatar #2" );

    // Add callback to button
    Button.onClick.AddListener( buttonCallback );
}