For example:
[System.Serializable]
public class A
{
[SerializeField]
public int x;
}
public class TestA : MonoBehaviour
{
[SerializeField]
public A a = new A();
}
[System.Serializable]
public class B : A
{
[SerializeField]
public int y;
}
public class TestB : TestA
{
// Not legal, I know. Considering Unity forbids the use of constructors in
// monobehaviour classes, I have no idea how I'd do this.
a = new B();
}
Given that this MonoBehaviour class "TestA" exposes an "A" object, I'd like to override this default value so that when a MonoBehaviour of type "TestB" is attach to a game object in the editor, an object of type "B" is exposed.
Perhaps I'm better off looking into creating custom property drawers, but I'm wondering if there is a way to do this with the default editor.