- Home /
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?
Answer by Ricardo · Mar 25, 2010 at 11:33 AM
More than a bug, it's a known limitation. Here's a request I just created for this feature.
Answer by baha · Apr 02, 2010 at 12:31 PM
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