So I have the code to create buttons at runtime. Now I’m trying to call a specific function when the mouse pointer enters the button.
For clicks on the button (UnityEngine.UI.Button) it is very simple:
button.onClick.AddListener(delegate
{
// Any code here
});
But how does one do this in a simple way for “on pointer enter” events?
Basically I am looking for something like:
button.onPointerEnter.AddListener(delegate
{
// Create tooltip
});