x


Public 2D array, accessed through the editor ??

I am trying to declare a public multidimensional array of GameObjects(Using JavaScript not c#) that I can access through the editor. However it would appear that only single dimension arrays are usable through the property inspector.

can anyone please help me out with this i know it is easily possible with c# but i want to know how it can be achieved using javascript.

Thanks in Advance

more ▼

asked Nov 08 '11 at 11:53 AM

crazyKnight gravatar image

crazyKnight
869 16 20 30

anyone looking for the c# code for the same problem http://forum.unity3d.com/threads/54707-2D-Arrays-in-C

Nov 08 '11 at 11:58 AM crazyKnight

You can't use multidimensional arrays in the inspector by default. I could show you how to do something which can be used like a multidimensional array in code, but which can be accessed properly in the inspector, but I only know how to do that in C#, and you've forbidden me from doing that. Sorry!

Nov 08 '11 at 12:06 PM syclamoth

well i have kept that as a last option if i dont get any solution,because my entire project is in java scripts and i dont want to mix it with c# scripts...i know it sounds a bit silly but i always try to complete the entire project using just one language, except for the plugins i always use c# for them....

Nov 08 '11 at 12:09 PM crazyKnight

@syclamoth : thanks for your help i know it is very easily possible with c#,but i am still trying to do it with javascript....if i don't get any solution then i will have to go by your way(c# rules)....

Nov 08 '11 at 12:12 PM crazyKnight

I agree that it's a bad idea to mix the two languages (causes a lot of problems). It's a shame I can't help you here, but you'll have to wait for one of the resident JS experts to arrive.

Nov 08 '11 at 12:16 PM syclamoth
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3459
x534
x355
x66
x16

asked: Nov 08 '11 at 11:53 AM

Seen: 1810 times

Last Updated: Nov 08 '11 at 12:32 PM