Siccity / SerializableCallback

UnityEvent and System.Func had a child
MIT License
359 stars 53 forks source link

BUG - You cant edit serialized fields in inspector when having one SerializedCallback #21

Closed Horothenic closed 3 years ago

Horothenic commented 3 years ago

I have the following elements elements in my inspector but I cant edit them, I had to remove the serialized callback, assign the things and then add it because I cant edit them anymore.

image image image

Horothenic commented 3 years ago

I can edit correctly on Inspector in Debug mode tho.

medvedya commented 3 years ago

I have the same one. I commented 27 line "property.serializedObject.Update();" in "SerializableCallbackDrawer", now it seems to work properly.

Siccity commented 3 years ago

Are you getting any errors in console?

medvedya commented 3 years ago

Are you getting any errors in console?

There are no errors after or before commenting 27 line.

LinusMC commented 3 years ago

I found the problem and fixed it. All the serialized fields above on SerializedCallback will not be applied. It caused by the Editor doesn't apply modified properties.

You can add the script "property.serializedObject.ApplyModifiedProperties();" on the first line of OnGUI in SerializableCallbackDrawer.