The length property of the array that returns or sets the number of elements in array.
function Start () {
var arr = Array ("Hello", "World");
// Prints "2"
print(arr.Length);
// resizes the array to a size of 5
arr.Length = 5;
}
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void Start() { ArrayList arr = new Array("Hello", "World");
// Prints "2" print(arr.Length); // resizes the array to a size of 5 arr.Length = 5; } }