The Event System and Event Triggers

When we originally created our Canvas GameObject, you may have noticed that an Event System GameObject was also created in our Scene. Unity assumes your UI will have some type of interactivity to it and uses a built-in script to help drive this. Of course, all of this might need to be done in your own scripts, but this method is a quick way of setting up some simple GUI elements. Figure 14.8 shows the default Event System that was created.

Image

Figure 14.8 Our default Event System Components

Event System

The Event System script itself has one variable slot for First Selected. This lets you place an initial GameObject ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation 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.