I have a gameobject inside which there are several sprites. I need to make this gameobject clickable (when clicked, the function is called with parameters).
buttons.GetComponent<Button>().onClick.AddListener(() => load_level(level_name_, location_name_)); How to write down a similar entry only for gm,
for such a record:
buttons.GetComponent<EventTrigger>().OnPointerEnter(() => load_level(level_name_, location_name_)); does not work
Upd:
I have an array of the gameobject and list with a set of data different for each gameobject, in a loop I pass this data into gameobjects. Therefore, I need to bind a function call with parameters from lista right away.