Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity Game Development Essentials

You're reading from   Unity Game Development Essentials If you have ambitions to be a game developer this guide is a must. Covering all the fundamentals of the Unity game engine, it will help you understand the different elements of 3D game creation through practical projects.

Arrow left icon
Product type Paperback
Published in Oct 2009
Publisher Packt
ISBN-13 9781847198181
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Will Goldstone Will Goldstone
Author Profile Icon Will Goldstone
Will Goldstone
Arrow right icon
View More author details
Toc

Creating the menu — approach 2


As we already have a working menu, rather than removing it from our scene, we will temporarily disable the objects that make it up. By doing this, you can choose which menu you prefer later and reinstate as necessary.

Disabling Game Objects

One at a time, select the PlayBtn, the InstructionsBtn, and the QuitBtn in the Hierarchy, and deactivate them by doing the following:

  • In the Inspector, deselect the checkbox to the left of the name of the object

  • Ensure that this has turned the text of the object to light gray in the Hierarchy and that the element itself has disappeared from the Game view preview

Writing an OnGUI() script for a simple menu

Now, create a new empty object by going to GameObject | Create Empty. This makes a new object in the Hierarchy called GameObject with only a Transform component attached. This will be the holder object for our GUI 2.0 menu. This is because the script we are going to write will need to be attached as a component in...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image