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

Scene initialization


Currently, our Options page is at 2000 in X position. This means that we can't see it in the Game view of the editor. Since we are going to work on the Options page again, it would be great to have a preview of what we're doing shown in the Game view.

Centering the options page

In order to see our Options page in the Game view again, we need to re-enable it and set it back to the center of the screen and then hide our main menu:

  1. Select our UIRoot | Options GameObject and enable it.

  2. Set its Transform position to {0, 0, 0}.

  3. Select our UIRoot | Main GameObject and disable it.

OK, we can now see our Options page in the Game view again. Sometimes, this kind of manipulation can be repetitive and annoying. Of course, you could simply move around your camera in the Scene view, but sometimes it's better to have a more accurate preview using the Game view.

In this case, we can have an Initialization.cs script attached to both windows that could enable/disable them and position them...