Book Image

Creating E-Learning Games with Unity

By : David Horachek
Book Image

Creating E-Learning Games with Unity

By: David Horachek

Overview of this book

Table of Contents (17 chapters)
Creating E-Learning Games with Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Refactoring our work


Now that we have a fully functional system for loading and unloading scene files, we will dedicate our attention to the integration and refactoring of the remaining GameObjects, hierarchies, and scripts.

The pop-up system

To refactor our pop-up system, perform the following steps to complete the moving of our game content from the testbed scene file to the MAIN scene file.

Updating level 3 pop ups

Let's begin by refactoring the pop-up panel system:

  1. Under _global, ensure that the player (named Player1), camera (named MainCamera), and game (named Game) child objects can be found. Also make sure that a GameObject of type GUITexture named score is present as shown in the following screenshot:

  2. We will change the behavior of the pop ups that are shown at the start and completion of each level. Rather than instantiating them from a Prefab, we will add them at design time in the editor and selectively activate and deactivate them as necessary. This will make the task of refactoring...