x


Using arrays in inspector variables

Is it possible? With Javascript?

On 2D Platform Game Tutorial I want to make multi targets to the platform mover script rather than just one, so I figured "why not an open array?", thus this question.

more ▼

asked Feb 25 '10 at 09:51 PM

Cawas gravatar image

Cawas
1.5k 31 38 54

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You can use arrays like Transform[] and GameObject[], but I don't think there's any easy way to use Array().

var targets : Transform[];
more ▼

answered Feb 25 '10 at 10:26 PM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

This actually solves my question, though it doesn't answer the generic question on the title.

Mar 09 '10 at 09:21 PM Cawas

I was wondering this too -- I tried adding an array member, but it was only showing Size 0, until I realized that the size was edit-able, duh!

Apr 21 '10 at 04:56 AM yoyo
(comments are locked)
10|3000 characters needed characters left

I believe what you want can be done with UnityEditor by customizing the inspector pane, but I am posting from my mobile and can not provide you with code atm.

http://unity3d.com/support/documentation/Components/gui-ExtendingEditor.html

more ▼

answered Feb 25 '10 at 10:23 PM

Kethis Celebes gravatar image

Kethis Celebes
149 8 9 18

I won't look into this now, but this is actually a better more generic way of answering the question, if it works.

Mar 09 '10 at 09:22 PM Cawas
(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x3570
x482
x371

asked: Feb 25 '10 at 09:51 PM

Seen: 4710 times

Last Updated: Feb 25 '10 at 09:51 PM