Mute buttons with image swap

Now, let's go back to working in our UI scene that we've been building out over the last few chapters. Open the Chapter5 scene. In the scene, we have a Pause Panel that pops up when the P key is hit on the keyboard. On this panel, we will place two mute buttons, one for music and one for sound that will toggle between muted and not unmuted states. The panel will appear, as shown:

To add the music and sound buttons, as shown in the preceding image, complete the following steps:

  1. First, we need to bring in a new art asset. The button images on the sprite sheet we imported previously are a bit too small and didn't ...

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.