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 CorrectResponse Prefabs


The CorrectResponse Prefabs are the pop ups that will be instantiated from the npcDialog (quiz cards) for LEVEL3. Create these according to the following steps:

  1. Copy and paste the popup_QuizSuccessQuestion Prefab into a new folder in the folder named Chapter 9.

  2. Create 50 unique CorrectResponse cards—one for each state/NPC dialog interaction.

  3. We do not need to pass missionToken into missionMgr when this pop up destructs itself, so ensure that there is no missionToken attached (it will do no harm, but it is redundant).

  4. Modify PopupButtonScript.cs and add an AwardPoints action. Make sure that when the button is clicked on each of these Prefabs, 500 points are awarded to the user. When the button is clicked, we simply find the player class and the playerData component, and then add these values to the score member variable as shown in the following code. Don't forget to add the action to the enumeration at the top of the file:

    // inside Dispatch()
    case(popupAction...