This is just a question of the interaction between Unity3d and a c# script. Currently I am using a script that makes the call:
The thing that's getting me is inside the inspector window, I am able to change the size of the array. Obviously its size must be dynamic, so I guess my question is: Is there a way to declare the array without assigning its size, since I can just change it in the inspector window anyways? Also, how would I get the size of the array if it were to be changed in the inspector?
There are several options.
1.. It sounds like what you want to do is just this. It creates an array that can be resized/ edited in the inspector.
To access the size of an array use array.Length. To access the number of items in a generic list use list.Count.
answered Jun 24 '10 at 06:03 PM
To answer your second question you can get the size using the Length property, e.g.
Also, you can resize the built in arrays using static members of the Array class, e.g.
Though as mentioned, it is often easier to use List<> if you'll do that often. The nice thing about normal arrays is they're faster to access.
answered Jun 24 '10 at 06:12 PM