Hi all
I’ve been trying to use SerializedObject and SerializedProperty to draw some ScriptableObjects in the inspector:
SerializedObject serializedKvp = new SerializedObject(kvp);
SerializedProperty valuesListProperty = serializedKvp.FindProperty("m_Value");
SerializedProperty modifierProperty = valuesListProperty.GetArrayElementAtIndex(index);
EditorGUILayout.PropertyField(modifierProperty, true);
What I’m getting is this:
Firstly, I don’t want the “Element 0” label, which I presume is Unity trying to be “helpful” because my property is a List index.
Secondly, I’m telling the PropertyField to draw the children and I’m not getting any. If I double click the PropertyField I get this in a new inspector:
So you can clearly see that the property has child properties.
Can anyone explain to me why this is happening and how I can improve it?
Thanks,
Ves