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
About the Author
About the Reviewers

Load additively

Recall from Chapter 4, Mission One – Future Proofing the Code, that Unity3D supports the development of games that span multiple scene files. One benefit of splitting a game up into multiple scene files is that we (as programmers) can assign different lifespans to objects based on the scene file they belong to.

The MAIN scene file is designed to not only be the entry point of our game, but it also contains the _global GameObject. This GameObject acts as the parent of a hierarchy of objects that have persistent scope throughout the game. The following GameObjects should have global scope:

  • MainCamera: This is the camera to which the scene will be rendered

  • Player1: This is the name of the GameObject that is the playable character or the hero of the game

  • Score: This is a GUIText element that displays the number of points the player has acquired so far

Every other GameObject will exist in one of the three scene files for the game—LEVEL1, LEVEL2, or LEVEL3. Using the Application.LoadLevelAdditive...