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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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.