Correct me if I'm wrong, but from the EventTrigger documentation, it appears as though there are three separate ways to use EventTriggers.
Method 1: Attaching an EventTrigger as a component to a gameObject. (Discussed in NOTE)
Method 2: Extend EventTrigger, and overriding the functions for the events you are interested in intercepting. (Discussed in Example 1)
Method 3: Specifying individual delegates. (Discussed in Example 2)
Are there an advantages or disadvantages for choosing one of the three methods over the others? I'm especially curious as to why to choose Methods 2/3 over Method 1.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Creating a custom slider - should I be invoking a UnityEvent onValueChanged?
UnityEngine.EventSystems.. Trying to figure it out .js
Triggering events for overlaying UI Elements.
Ui Elements and Unity Events
Hide/show UI Button and trigger the OnPointerDown event ?!