O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

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 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.

  1. Open up the TargetBehaviour script, and in the Start function, remove the following line:
    ShowTarget(); 

    This will keep the targets in their original position until we are ready for them to be shown.

  2. 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 of GameController. 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 ...

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