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

Modifying the LevelLogicObj object


The LevelLogicObj object will track the condition when the player has achieved a high score that is enough to earn the level finished pop up and to win the game. To implement this with the technology we already have, we will perform the following steps:

  1. In decisionMgr of npcScript on LevelLogicObj, set the number of interactions to 2. This is required because the LevelLogicObj object will process two interactions each frame.

  2. Create an instance of a floatData condition on LevelLogicObj. Drag-and-drop this into the first condition. Make sure there is only one instance of this script on this object in the editor.

  3. Create an instance of the condition_addScore condition on LevelLogicObj. Drag-and-drop this into the second condition. Set the scoreAdded variable on the condition to 2500, and drag-and-drop the setupLevel3 object into the initalValue reference to associate the initialValue condition component attached there into this component.

  4. Create an instance of...