Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2019.4.31f1
2020.3
2021.1
2021.2
2022.1
Issue ID
1372744
Regression
No
Editor Change Check does not detect change when adding a GameObject into a serialized field
How to reproduce:
1. Open the attached project "ChangeCheckBug.zip"
2. Open "SampleScene"
3. Select "SelectGameObject"
4. Place a GameObject inside an "Element [x]" field on the "Foo" Component
Expected result: The GameObject is serialized into the field
Actual result: The GameObject is not serialized into the field
Reproducible with: 2019.4.32f1, 2020.3.22f1, 2021.1.28f1, 2021.2.2f1, 2022.1.0a15
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
Resolution Note:
The implementation of ChangeCheckScope.changed will automatically call EndChangeCheck(), so it cannot be reused after that to detect changes later on in the loop. As mentioned in the bug description the code can work properly by only checking once, e.g. outside the loop. Another alternative would be to move the using statement inside the loop. There is also a SerializedObject.hasModifiedProperties property that might be helpful.