An example

Let's create a new C# script and call it learningLoopsFor:

Then we open the script and we are going to create a List that will contain the names of the family members. We always start the script by writing down the variables that we'll be using, in this case it will be the List<string>:

After that, we need to add the family members to our List and we are going to do all that inside the void Start():

To conclude our script now, we ...

Get Learning C# 7 By Developing Games with Unity 2017 - 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.