|
Creates an Array of a fixed size.
var arr = new Array(5);
Debug.Log(arr.length);
Initialize a JavaScript array from a .Net Array.
// Creates an empty int array of 5 positions, converts it to a
// JavaScript array and prints the content of the JavaScript array.
var intArray : int[] = new int[5];
var convertedArray : Array = new Array(intArray);
for (var i = 0; i < convertedArray.length; i++) {
Debug.Log("ConvertedArray[" +i + "]: " + convertedArray[i]);
}
Creates an empty array
var arr = new Array ();
// Add one element
arr.Push ("Hello");
// print the first element ("Hello")
print(arr[0]);