Hi,
I want to serialize a list of values,value could be float,vector,color,etc.
public class MyData
{
public int type;
public object value;
}
I notice ScriptableObject can not serialize object,values are always null.
The only method I know is declare all possible Types in MyData class,like
public class MyData
{
public int type;
public Vector3 vectorValue;
public Color colorValue;
public float floatValue;
//...All possible types
}
I think there should be a better way to serialize generic values.