For example, for detecting clicks, I'm using onClick event trigger, but I can't find anything related to something like a onHover event
Due to that piece of your question, I assume that what you want to find out is how to detect mouse hovering over UI Buttons in Unity (version above 4.6). To do that, you do the following:
- Select the desired UI Button
Scroll down the inspector and click the "Add Component" button
In the list of components that will appear, select "Event" and then "Event Trigger"
- You will notice that a new "Event Trigger" area appears in the inspector for the button
There, click on the "Add new even type" button
A list of even types will pop-up. Choose "PointerEnter"
Next, on the "PointerEnter" sub-area that will appear within the "Event Trigger" area in the inspector (when your button is selected, of course), click on '+' to add a new item to the list of events
- from here on, you just do the same as if you were playing with OnClick events in the inspector, i.e. you just select the object containing the function you want to run when the button is hovered. Then, you select that function.
If you have a lot of buttons and want to automate the process, you can achieve that via script: for each of your buttons you do something like the following (I have not been able to test this myself, unfortunately):
EventTrigger.Entry eventtype = new EventTrigger.Entry();
eventtype.eventID = EventTriggerType.PointerEnter;
eventtype.callback.AddListener((eventData) => { YourDesiredFunction(); });
GameObject newbutton;
newbutton.AddComponent<Button>();
newbutton.AddComponent<EventTrigger>();
newbutton.GetComponent<EventTrigger>().triggers.Add(eventtype);