- Home /
Question by
EMOTION-THEORY · Nov 29, 2014 at 07:58 AM ·
c#editorlistinspectorserialization
How do I make child classes in a list editable from the Inspector?
I just can't seem to find the answer to this.
If I have:
[Serializable]
public class Parent
{
public string parentString;
}
[Serializable]
public class Child : Parent
{
public string childString;
}
public class MonoClass : MonoBehavior
{
public List<Parent> myList;
}
and my MonoClass is attached to a gameobject in the scene. How do I edit values from the child class in the list? (i.e. the childString var)
How do I make Unity serialize the child variables in a parent list?
Any help is much appreciated. This information actually seems to be unavailable from the internet (or I've just tried that hard looking for it and failed miserably).
Comment