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

Using the setupLevel3 Prefab


The setupLevel3 Prefab will be activated when the user presses the popup_Level3Start button. It will initialize the NPCs for the level, place them in random locations in the world, and set up the state tracking logic that determines if the player achieves success. Perform the following steps to use the setupLevel3 Prefab:

  1. Locate the Prefab named setupLevel2 beneath _level2, and rename it setupLevel3. Duplicate the SetupMissionTwo script from mission two, and rename the duplicate to SetupMissionThree. Place the duplicate in the folder named Chapter9 to keep your assets organized.

  2. Add an instance of this script to the setupLevel3 object.

  3. Inside MonoDevelop, change the class declaration to SetupMissionThree so that it matches the name of the script as shown in the following code:

    public class SetupMissionThree : MonoBehavior
  4. We will use the same pattern to choose random NPC locators as we did for the QuizNpc locators in mission two. We will remove the CorrectPopups list...