Hello,
i wanted to ask, if it is possible to simulate a click on a canvas button script based. I need to call the functions that the On Click event has.
As far as I know you can’t retrieve the functions that are there, but you can simulate the click by calling:
testButton.onClick.Invoke();
var pointer = new PointerEventData (EventSystem.current);
ExecuteEvents.Execute (myButton.gameObject , pointer , ExecuteEvents.pointerClickHandler);