Simulating the collection of cherries

In this section, we will continue working on the CucumberManManager script to simulate the collection of cherries.

If you do not already have the script open, open it now in an editor. We will review the updated code in five sequential sections.

Our first section, shown here, imports the three necessary namespaces.

using System.Collections;    using System.Collections.Generic;    using UnityEngine;     public class CucumberManManager : MonoBehaviour {        public static int currentCherryCount;       public int tempCurrentCherryCount;       public bool collectingCherries; 

The fourth line of code is the class declaration statement. The last three lines of code in this section are the class variables. Here is a brief description ...

Get Getting Started with Unity 2018 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.