Join Jesse Freeman for an in-depth discussion in this video Understanding the event trigger, part of Unity 5: UI.
- While it's convenient to use On Click,…from the button component, we may want to get…more events from the button itself.…One of the ways that we can do that…is to add a component called an Event Trigger.…Let's add this to our button.…Before we start using the Event Trigger,…let's select the item we have On Click…and remove it.…Then, in the Event Trigger,…let's create a New Event Type.…
As you can see, we have a wide range…of events that we can now listen to.…Let's reconnect our button back to our button test script.…Here we'll use the Pointer Click, just like we had before.…Inside of this, we'll click +, and re-link the objects.…We'll select the GameLogic Game Object…from the scene, and we'll select…the On Click method.…If we clear the console, and run the game, and press…on the button, we'll see…that they are connected.…
Let's stop this, clear the console,…and add a few new events.…Let's switch over to our Button Test Script.…Next, we're going to add an On Over,…and an On Exit method for us to call.…Then inside each of these we'll do…
- Adding new components to the Canvas
- Working with RectTransforms
- Nesting UI elements
- Adding rich text and effects to the UI
- Creating images
- Styling UI buttons
- Handling input
- Creating sliders
- Controlling the layout of the screen
- Adding toggles and dropdowns
Skill Level Intermediate
1. The Canvas
2. Working with the RectTransform
3. Working with Text
4. Working with Images
5. Working with Buttons
6. Handling UI Input
7. Working with a Slider
8. Controlling Layout
9. Toggles, Dropdowns, and the Input Field
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.