Now that our main menu appears smoothly, let's make sure it disappears smoothly before it exits the game.
In order to make this window scale down, we can simply request the tween to play in reverse. That's where the UIPlay Tween
component comes in: it lets us play any other tween in the scene on a specified event, with different behaviors.
Add the UIPlay Tween
component to our Exit
button:
In Hierarchy, select our
Button
|Exit
GameObject.Click on the Add Component button.
Type
play
with your keyboard to search for components with that word.Select Play Tween
Ok, we just added the UIPlay Tween
component to our exit button. Let's see what its parameters are before we configure it.