Change Unity UI Button parameters

I was wondering if there is a way to change a buttons parameters? I need to change the “object” and the “method” under the “OnClick()”.

I have googled it and found how to change the method but not the object parameter under the “OnClick()”.

is this possiable?

I believe the object parameter when setting in the inspector is just there filter what you can see in the method dropdown. Otherwise you could potentially see hundreds if not thousands of methods. When setting via code you don’t need to worry about that, just set the method.