Reader small image

You're reading from  Creating E-Learning Games with Unity

Product typeBook
Published inMar 2014
Reading LevelIntermediate
Publisher
ISBN-139781849693424
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
David Horachek
David Horachek
author image
David Horachek

David Horachek is a video game software developer with over 13 years of experience in programming arcade, home console, and portable games. He has programmed game projects published by Midway Games, EA, Ubisoft, SEGA, and others. He develops games under the Arbelos Interactive label.
Read more about David Horachek

Right arrow

Testing our work


Let's trace through how the pop-up system works. When the main scene first loads, the popup_MainMenu Prefab renders in front of the camera. It does this because it is parented to the main camera's transform as a child object. This means that no matter what position and orientation the camera has, the pop up will move relative to this and always be on the screen, effectively in screen coordinates. This is a common trick in game programming used to achieve quasi-2D screen space results with 3D objects.

When the New button is clicked, the popupButtonScript iterates over the action array, and based on the enumeration for the action, it dispatches an appropriate command. For now, we set the GameState to loading level1 and let the gameManager script handle the loading of the new scene file. We then call SelfDestruct to delete the MainMenu object from the world (we won't need it anymore as we are in-game).

When the Info button is clicked, the popupButtonScript iterates over the action...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Creating E-Learning Games with Unity
Published in: Mar 2014Publisher: ISBN-13: 9781849693424

Author (1)

author image
David Horachek

David Horachek is a video game software developer with over 13 years of experience in programming arcade, home console, and portable games. He has programmed game projects published by Midway Games, EA, Ubisoft, SEGA, and others. He develops games under the Arbelos Interactive label.
Read more about David Horachek