UI Buttons

UI Buttons are objects that are meant to be clicked, but they can also respond to other actions, for example, when the mouse hovers over them; the following screenshot shows the Button component:

UI Buttons

When you create a UI button, the Button component is automatically added to it, but an Image component is also automatically added to it. This determines what the Button will look like in its normal state.

Transition types

By selecting from the Transition drop-down menu, you can determine how the button reacts to being pressed, when it is hovered over, or when it is disabled. The three Transition options are Color Tint, Sprite Swap, and Animation ...

Get Mastering Unity 2D Game Development - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.