Is it maybe this?
Unity button onclick function script callback gameobject notes:
For sliders and dropdowns and other value-returning UI elements: