From the course: Unity 5: 2D Advanced UI

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Create a toggle button prefab

Create a toggle button prefab - Unity Tutorial

From the course: Unity 5: 2D Advanced UI

Create a toggle button prefab

- [Voiceover] The last UI element we're going to want to create is a toggle button. Let's go back to our canvas, right-click, go to UI and select the Toggle. We'll want to move this down and out of the way as well. With the toggle selected, let's go ahead and change the transition to none. We'll change navigation to explicit and as we scroll down even more in the inspector, let's change the toggle transition to none. Now we need to make the toggle button look like the rest of our UI. Let's unfold toggle from the hierarchy and take a look at the label first. We'll set it to our default font and change the color to white. Everything else should basically stay the same. Let's take a look at the background and disable the image and in the check mark, we're going to change this to the icon cursor. Now you'll notice since the image for the checkbox was much larger than before, we're going to want to move the text over just a little bit. So let's go back to our label and change the left…

Contents