Book Image

Learning NGUI for Unity

By : Charles Bernardoff (EURO)
Book Image

Learning NGUI for Unity

By: Charles Bernardoff (EURO)

Overview of this book

Table of Contents (17 chapters)
Learning NGUI for Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Menu disappearance


Now that our main menu appears smoothly, let's make sure it disappears smoothly before it exits the game.

UIPlay Tween

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.

Usage

Add the UIPlay Tween component to our Exit button:

  1. In Hierarchy, select our Button | Exit GameObject.

  2. Click on the Add Component button.

  3. Type play with your keyboard to search for components with that word.

  4. Select Play Tween and hit Enter or click on it with the mouse.

Ok, we just added the UIPlay Tween component to our exit button. Let's see what its parameters are before we configure it.

Parameters

Now added to our exit button, the UIPlay Tween component has nine parameters, as shown in the following screenshot:

  1. Tween Target: Drag here the GameObject on which your tween component is attached.

  2. Include Children: If checked...