unity c# arrays code example

Example 1: unity array c#

string[ ] familyMembers = new string[]{"John", "Amanda", "Chris", "Amber"} ; 
 
string[ ] carsInTheGarage = new string[] {"VWPassat", "BMW"} ; 
 
int[ ] doorNumbersOnMyStreet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; 
 
GameObject[ ] carsInTheScene = GameObject.FindGameObjectsWithTag("car");

Example 2: unity array c#

public string[ ] familyMembers = new string[ ]{"Greg", "Kate", "Adam", "Mia"} ;

Example 3: unity array c#

new List();

Example 4: unity array c#

GameObject[ ] carsInTheScene = GameObject.FindGameObjectsWithTag("car");

Tags:

Misc Example