Search Issue Tracker

By Design

Votes

0

Found in

2019.2.0a1

2019.3.0a1

2019.3.0f3

2020.1.0a1

Issue ID

1205928

Regression

No

Undo/Redo action invalidate SerializedObject in Inspector when adding/removing elements in array using SerializedProperty

Serialization

-

How to reproduce:
1. Open attached project ("SO-REPRO.zip")
2. Create SerializedObject asset (Assets->Create->BugReport->SO)
3. Select "testasset" asset
4. Open Inspector window
5. Press + sign multiple times
6. Perform undo action multiple times (CTRL-Z or Edit->Undo Inspector)
7. Press + sign multiple times

Expected result: First and further Undo/Redo calls are performed as expected
Actual result: First Undo/Redo isn't performed

Reproducible with: 2019.2.17f1, 2019.3.0f3, 2020.1.0a17
Not tested with: 2017.4.35f1, 2018.4.15f1 (no suitable method found to override CreateInspectorGUI())

Notes:
- After Undo/Redo call first + (add) action isn't performed
- After Undo/Redo call last entry - (remove) action isn't performed at all

  1. Resolution Note (2020.1.X):

    When reacting to Undo.undoRedoPerformed, the serializedObject has not been updated by the inspector just yet. The workaround is to either wait until the next frame so the inspector has updated the serializedObject, or do it ourselves.

    From 19.3, one can use a ListView with serializedObjectBindings to automatically refresh arrays.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.