Making UI elements affected by different lights

To give a professional touch to our user interface, we can add lights to it. This could be effective if we want to create a specific type of atmosphere or emphasize an element. In fact, Unity allows us to alter UI elements by light. In this recipe, you will learn how to create two UI elements and, using layers, how to have them affected by different lights. In order to do this, we will add two new layers, create a new UI material, and of course play with lights.

How to do it...

  1. We need to create two panels that are slightly separated, as shown in the following screenshot. From this, you can learn how to affect different UI elements with different lights. To create the panels, right-click on the Hierarchy ...

Get Unity UI Cookbook now with O’Reilly online learning.

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