O'Reilly logo

Learning C# by Developing Games with Unity 3D Beginner's Guide by Terry Norton

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

Time for action – create a List of pony names

Create a List that stores the names of some ponies. Since they are names, use the string type.

  1. Modify LearningScript as shown in the next screenshot.
  2. Notice the change on line 2.
  3. Save the file.
  4. In Unity, click on Play.
    Time for action – create a List of pony names

What just happened?

The following screenshot is the Console output. Notice the first output tells you there is a total of 3 elements in the List:

What just happened?

Note

Please notice that your code is using dot syntax, which will be discussed in more detail in the next chapter. The main concepts I want you to focus ...

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