Search Issue Tracker
By Design
Votes
8
Found in
2021.3.9f1
2022.1.15f1
2022.2.0b7
2023.1.0a9
2023.2.0a1
2023.3.0a3
Issue ID
UUM-13181
Regression
No
VisualElement.TrackPropertyValue doesn't invoke the callback when the property is under SerializeReference and SerializeField attributes
How to reproduce:
1. Open the user’s attached “Repro-UxCallback” project
2. Select “test asset” asset in the Project Browser
3. Change the value of “My Interface → Name” field in the Inspector
Expected result: Two messages are printed in the log
Actual result: Only the “SerializedObject tracking” message is logged, and not the “SerializedProperty tracking”
Reproducible with: 2021.3.9f1, 2022.1.15f1, 2022.2.0b7, 2023.1.0a9
Couldn’t test with: 2020.3.39f1 (TrackPropertyValue method isn’t featured)
Reproduced on: macOS 12.5 (Intel)
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
- Spot Light with 'Box' Shape stops working when it collides with Mesh
- Accepting Asset Store EULA endless loop in Package Manager window
- “InvalidOperationException: Sequence contains no matching element“ error when reenabling a custom Debug Draw Mode
- Prefab that contains a layout group is marked as changed by the Editor when opened
- Emission animation does not appear when the "Emission Map" parameter is set to black in a Lit material
Resolution Note:
The repro project uses TrackPropertyValue for "myInts.myInterface", which is the reference itself. That reference's value doesn't change: it refers to the same StringAAA instance throughout. What changes is the "myInts.myInterface.name " property, which, if used in TrackPropertyValue, triggers the callback as expected.
If the user doesn't want to be explicit about tracking inner properties of serialized references, they can also use a custom PropertyDrawer for their specific implementations of the interface, in this case StringAAA, and track the property changes that correspond to their specific fields in the PropertyDrawer's implementation, where the complexity is properly encapsulated.
Tracking changes in the contents of the SerializedRerefence is not supported and is not what this feature was intended for.