Unity-Could someone explain how the onClick event works in unity 2022.3 and above

60 Views Asked by At

I'm working on the 2022.3.5f1 version of unity and its onClick event for buttons ask for parameters that I'm not familiar with. Could someone explain what I'm supposed to input for target assembly, mode, and arguments. Here are the function that I'm trying to call and a view of the onClick event that I'm talking about. After inputting the object containing my function and the function name into the parameters, I tried clicking my button, but the function did not get called.

the onclicked parameters that I'm referring to

the method I'm trying to call

1

There are 1 best solutions below

0
derHugo On

Looks like your Inspector is in Debug Mode.

In that mode you see all fields etc via the default drawer without applying any built-in or custom special editor drawers.

What you see there is how the onClick event looks like (apparently) without using Unity's special editor drawer for it - which usually filters and only displays the relevant fields and also does some work in the background to handle your target object reference and method selection.

See Working with the Inspector → Toggle Debug Mode