March 2018
Beginner
336 pages
8h 6m
English
Our last points-related task is to update the BeetleNPC script so that appropriate points are added when a cherry hits a cucumber beetle. Here are the steps:
_ptsManager = GameObject.Find ("Score_Value").GetComponent<PointsManager> ();PointsManager.currentScore = PointsManager.currentScore + 10;
The two preceding lines of code create a reference to the PointsManager script and, on the second line, increment the currentScore by 10.
The updated BeetleNPC ...
Read now
Unlock full access