Creating a slide shower using a discrete slider

Here, we can go further in providing additional customization for the player. In this case, we are going to implement a slide shower. The player will be able to scroll between pictures using a slider. To achieve this, we will see how to write a script to run this system. Again, we will use the events from the Slider (Script) component.

How to do it...

  1. To begin, we need to create our slider, which will be the controller of the player, so let's right-click on the Hierarchy panel and then go to UI | Slider. Finally, rename it to SlideShowerSlider.
  2. Then, select the slider and, in the Inspector, navigate to Add Component | New Script. Name it to SlideShowerScript and then click on Create and Add.
  3. Now, double-click ...

Get Unity UI Cookbook 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.