Creating waves of targets
Now that we have all of the pieces together, let's make it so that we will only spawn a few ducks at a time and have a few of them appear at a time.
Open up the
TargetBehaviour
script, and in theStart
function, remove the following line:ShowTarget();
This will keep the targets in their original position until we are ready for them to be shown.
Next, we will create a new script named
GameController
by going to the Project tab and then selecting Create | C# Script and once it appears give it a name ofGameController
. Double-click on the file to open up your IDE of choice and add the following code:using UnityEngine; using System.Collections; // IEnumerator using System.Collections.Generic; // List public class GameController : MonoBehaviour { public static GameController _instance; [HideInInspector] // Hides var below from inspector public List<TargetBehaviour> targets = new List<TargetBehaviour>(); void Awake() { _instance...