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:
Create a new script named
condition_scoreAdded
. Change the base class fromMonoBehavior
tonpcCondition
as done with the other condition classes.Add an instance of this script to
LevelLogicObj
.Drag-and-drop this script instance into the second slot of
decisionMgr
onLevelLogicObj
as shown in the following code:Inside the script, add an
int
datatype forscoreAdded
; this is the number of points necessary for the condition to returntrue
:public int scoreAdd;
Add an
npcCondition
calledinitialScore
. Drag-and-drop the instance of this script fromsetupLevel3
(remember the object that first stored the score on...