x


Classes that contain an array of its own type do not appear in the inspector

Hello,

I have a simple class that contains an array of its own type

[System.Serializable]
public class Temp {
    public int m_Value;
}

[System.Serializable]
public class Test {
    public Test[] m_Array;
    public Temp[] m_TmpArray;

}

in the inspector i can see m_TmpArray but not m_Array. TmpArray is another custom class, with no parent classes. Is this a bug?

more ▼

asked Mar 25 '10 at 10:09 AM

pkamat gravatar image

pkamat
443 11 12 20

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

2 answers: sort voted first

More than a bug, it's a known limitation. Here's a request I just created for this feature.

more ▼

answered Mar 25 '10 at 11:33 AM

Ricardo gravatar image

Ricardo
5.2k 20 32 96

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

in this case you need to customize the inspector to fit to your needs by using a CustomEditor for your component that is using the class, i have faced the same problem and you need to create a recursive function to draw the inspector for you and loop through the array items

more ▼

answered Apr 02 '10 at 12:31 PM

baha gravatar image

baha
265 7 8 13

(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:

x1363
x468
x181

asked: Mar 25 '10 at 10:09 AM

Seen: 1698 times

Last Updated: Mar 25 '10 at 12:58 PM