//Script A\\
public class A : MonoBehaviour {
public B b;
[System.Serializable]
public class B {
public GameObject go;
}
}
// Script A's custom editor\\
[CustomEditor(typeof(A))]
public class AEditor : Editor {
A t;
private void OnEnable() {
t = target as A;
}
public override void OnInspectorGUI() {
t.b.go = EditorGUILayout.ObjectField("Go", t.b.go, typeof(GameObject), true) as GameObject;
}
}
Why? I stuck here for awhile and cant find a solution. Im using 2020.1.0a14.