ArrayArrays allow you to store multiple objects in a single variable. The Array class is only available in Javascript. For more information about ArrayLists, Dictionaries or Hashtables in C# or Javascript see here Here is a basic example of what you can do with an array class function Start () { There are two types of arrays in Unity, builtin arrays and normal Javascript Arrays. Builtin arrays (native .NET arrays), are extremely fast and efficient but they can not be resized. They are statically typed which allows them to be edited in the inspector. Here is a basic example of how you can use builtin arrays. // Exposes an float array in the inspector, Builtin arrays are useful in performance critical code (With Unity's javascript and builtin arrays you could easily process 2 million vertices using the mesh interface in one second.) Normal Javascript Arrays on the other hand can be resized, sorted and can do all other operations you would expect from an array class. Javascript Arrays do not show up in the inspector. You can easily convert between Javascript Arrays and builtin arrays. function Start () { Note that in the following all functions are upper case following Unity's naming convention. As a convenience for javascript users, Unity also accepts lower case functions for the array class. Note: Unity doesn't support serialization of a List of Lists, nor an Array of Arrays. Variables
Constructors
Functions
|
