O'Reilly logo

Creating E-Learning Games with Unity by David Horachek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the AddScore condition

The AddScore condition will be used by levelLogicObj to track the points earned in this mission. Once the requisite number of points have been earned, this script will return true. This, in turn, will dispatch the response of showing the Success pop up via the ShowLevel3Results response script. Writing this script requires the following steps to be performed:

  1. Create a new script named condition_scoreAdded. Change the base class from MonoBehavior to npcCondition as done with the other condition classes.
  2. Add an instance of this script to LevelLogicObj.
  3. Drag-and-drop this script instance into the second slot of decisionMgr on LevelLogicObj as shown in the following code:
  4. Inside the script, add an int datatype for scoreAdded ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required