Serialise inherited list object

I used a custom list class that inherits from generic.list

[System.Serializable]
public class ObservedList<T> : List<T>

If i use it as follows:

public ObservedList<Row> a = new ObservedList<Row>();
public List<Row> b = new List<Row>();

Only b will display in the inspector. Any idea why or how i can fix it?

Custom generic classes won’t get serialized. You need to define non-generic versions of it:

[Serializable] public class StringObservedList : ObservedList<string>
[Serializable] public class ObjectObservedList : ObservedList<Object>

public StringObservedList myList = new StringObservedList ();

By making the variabel type a normal lsit and then casting it as my Observed list i was able to get the inspector to show it as it should. See example below

[SerializeField]
private List rowList = new ObservedList();
public ObservedList RowList
{
    get { return (ObservedList<Row>)rowList; }
    private set
    {
        rowList = value;
    }
}