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

Creating the setupLevel2 Prefab


The setupLevel2 Prefab will be activated when the user presses the start button on popup_Level2Start. It will finish the initialization of the mission for the level in the missionMgr script. Let's perform the following steps to create the setupLevel2 Prefab:

  1. Create a new Prefab named setupLevel2. Duplicate the SetupMissionOne script from mission one, and rename the duplicate SetupMissionTwo. Add an instance to setupLevel2.

  2. Inside MonoDevelop, change the class declaration to SetupMissionTwo as shown in the following line of code:

    public class SetupMissionTwo : MonoBehavior {
  3. We will use the same pattern for choosing random QuizNpc locators as we did for the flag locators in mission one. In addition to the QuizNpc Prefabs and the spawnPoints lists, add a list of CorrectPopups to the class.

  4. This class will hold the pop ups that are shown to the user when a correct answer is given for a particular quiz question. This will be populated by the user in the editor, and...