Creating an extendable and rotating element with a final fade effect

In this recipe, you will learn how to create an extendable and rotating UI element with a final fade effect. This recipe is an extension of the previous one. In fact, we will add some controllers to the rotation. By extending the script that we made in the previous recipe, we can create more complex decorating elements for our UIs.

How to do it...

  1. To begin, we need to create a UI element. In this example, we will use a square, but you can also use any other image, such as a decorative star or a circle. To do this, create the UI element, right-click on the Hierarchy panel, and then navigate to UI | Image. Finally, rename it Extendable and Rotating Element. Of course, it is also ...

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.