- Home /
Question by
cy2342 · Sep 15, 2011 at 01:39 AM ·
builtin array
how to declare/assign an builtin multi-dimensional array in one statement?
such as,
var abc:int[,,] = [[1,2,3]];
I have tried substituting the [ with { and ( in all combinations, but it seems none of them workd.
Comment
Answer by dietclnp · Sep 15, 2011 at 01:56 AM
Hi. A quick googlin' provided this link in regards to JavaScript: JavaScript: Multi-dimensional array
I use C# with Unity so I'm unsure if this technique is the best when working with Unity's flavor of JS.
If you'd prefer C#, it's pretty straightforward, from the MSDN Example:
int[,,] myArray = new int [4,2,3];
EDIT: Here is some info from the Unify Wiki on multidimensional arrays in JS.
no, this will not work. The man said he tried. Also, it is very hard to find an answer to that question. $$anonymous$$aybe it's not supported in unity js.
Your answer
![](https://koobas.hobune.stream/wayback/20220612213147im_/https://answers.unity.com/themes/thub/images/avi.jpg)