O'Reilly logo

Creating E-Learning Games with Unity by David Horachek

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

Adding another data condition

Just as we saw in Chapter 7, Mission Two – Testing a Player's Learning, when we created listData npcCondition which wrapped a list of GameObjects used to track racers in the race, we will need to create another type of wrapper in this mission; one for the initial score of the player. We can create this list with the following steps:

  1. Copy and paste listData.cs into the folder named Chapter9. Rename the copy floatData as shown in the following screenshot:
    Adding another data condition
  2. Update the declaration in the script to match the new name of the file.
  3. Replace the list<GameObject> _listData variable with the following line of code:
    public float _floatData; ...

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