initialising arrays inunity script code example
Example 1: unity make a int arry with preset values
// For a preset arry in c#
var arr = new string[3] {"one", "two", "three"};
// Or you can do this:
string[] arr = {"one", "two", "three"};
Example 2: unity array c#
GameObject[ ] carsInTheScene = GameObject.FindGameObjectsWithTag("car");