OnValueChanged doesn't seem to be called after doing an undo operation

Issue #427 new
קובי אהרונסון
created an issue

OnValueChanged doesn't seem to be called after doing an undo (ctrl+z), the inspector does change correctly but the function isn't called.

Comments (1)

  1. Michael Ryan

    I have the same problem on Unity 2018.3.0 with Odin 2.0.13.

    In my situation, the OnValueChange method sets the enabled state of a couple child objects, so when the UNDO action fails to trigger the OnValueChange method, the child objects no longer match the field value.

    I was able to get around the UNDO action failing to call OnValueChanged by using some UnityEditor.Undo.RecordObject() calls in the method, which is perhaps the right thing to do anyhow ... but those lines need to be wrapped in #if UNITY_EDITOR due to editor code being called in a MonoBehaviour.

  2. Log in to comment