- Home /
Question by
mighty_ernie · Jul 03, 2011 at 09:35 PM ·
editor-scriptingproperty
Unable to edit PropertyField's in my custom editor
I'm writing a custom editor and trying to get a portion of it to show the contents of a class (and have those contents be editable). Unfortunately, while the contents and their respective widgets show up, I can't modify them :(. And thoughts as to why? Here's the code I'm using, 'obj' is a SerializedObject.
SerializedProperty prop = obj.GetIterator();
prop.NextVisible(true); // Grab the first property
do
{
EditorGUILayout.PropertyField(prop);
} while (prop.NextVisible(false));
Comment
Best Answer
Answer by mighty_ernie · Jul 03, 2011 at 09:38 PM
Nevermind, found out the problem. I forgot to call ApplyModifiedProperties() on 'obj' afterwards. How embarassing...