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 ShowLevel3Results response


The ShowLevel3Results class will be used to show the success pop up (and some associated cleanup) if the user achieves enough points. It will be dispatched by npcDecisionMgr of LevelLogicObj in this level. Perform the following steps to create the ShowLevel3Results response:

  1. Create a new npcResponse class named response_ShowLevel3Results. Change the parent class from MonoBehavior to npcResponse.

  2. Open the scene file from the last gameplay level TESTBED1.

  3. Copy the popup_Level1Finished Prefab by pressing Ctrl + C.

  4. Open the scene file from the last gameplay level TESTBED3.

  5. Paste this GameObject beneath the hierarchy of MainCamera. Rename the popup_Level3Finish object as shown in the following code:

  6. Add an instance of the response_ShowLevel3Results script to LevelLogicObj.

  7. Drag-and-drop a reference to this script into the Response field beside condition_addScore in decisionMgr for LevelLogicObj.

  8. Drag-and-drop a reference from popup_Level3Finish (inside the MainCamera...