Sprite Swap

The Sprite Swap Transition type will make the button change to different images for different states.

You'll note that there is no property to assign a sprite for the normal state. This is because the normal state will just use the sprite assigned to the Image component.

The sprite sheet we imported in Chapter 2, Canvases, Panels, and Basic Layouts, containing our UI images has four button images that will be helpful in demonstrating the Sprite Swap Transition: the images labeled uiElement_39, uiElement_40, uiElement_41, and uiElement_42 (as shown in the following screenshot):

To have the button take on these images at the appropriate ...

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.