Creating a menu with an entrance transition
We may want a more complex animation than simply an appearing/disappearing effect as covered in the previous recipe. In this case, we need to use an Animator controller along with the Animation window in order to create animations. In this recipe, you will learn how to create an entrance transition. However, feel free to change the animation when performing the following steps to fit the needs of your game. Furthermore, we will still be using the OnClick() event to cause PauseMenuButton to disappear.
How to do it...
First of all, we need to create our menu. To do this, just follow the first three steps of the previous recipe, Appearing and disappearing menu.
Next, we need to place Appearing Menu slightly outside Canvas, as shown in the following screenshot:
After we have selected Appearing Menu, we can click on Add Property in the Animation window. Unity asks us to choose a folder and a name for our animation. For now, let's name it MenuEntryTransition...