Event inputs

As stated in the Event Trigger section, you may not want to use an Event Trigger component, because the Event Trigger component causes the object on which it is attached to receive all the events listed in the Event Trigger section. So, if you are worried about performance issues, you will want an alternate way to receive events on an object.

All event types that were available to add in the Event Trigger can also be added to an object via code without using the Event Trigger component. To use an event without the Event Trigger component, you must derive your script from the appropriate interface and know the type of event data class that the event uses.

An interface is a template that defines all the required functionality that ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.