As question suggests,
I have
[Serializable]
public class Parent
{
public float myFloat;
}
[Serializable]
public class Child : Parent
{
public string childString;
}
public class MonoClass : MonoBehavior
{
public List myList;
}
I have MonoClass attached to a gameobject. I can edit the list of Parent but if there's a Child in that list, I can't edit the Child (I can't assign values to childString).
If I have a list of Parent objects, how can I basically get every object in the list to show a default editor for each class subtype?
Now... I KNOW this requires a custom editor. I've done my research. However, nowhere have I seen HOW this can be accomplished.
As a stretch goal, I'd like to be able to pick a subtype from a dropdown list to add to the list. That way I can add all eligible types to the list (and then of course, edit them).
Cheers!
↧