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
- Crash on ParticleSystemTrailGeometryJob::RenderJobCommon when changing trail Mode change with a large particle count
- Mouse cursor does not revert to the default mouse cursor when pressing the "Add column" button in the Search window
- ArgumentException is thrown and textures become unreadable when AssetBundle.Unload(false) is called
- URP Tab Reset Menu Button Is Invisible in Light Mode
- Editor crashes on "(Unity) WriteObjectToVector" when entering into the Play Mode
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.