Search Issue Tracker
By Design
Votes
0
Found in
2022.3.33f1
6000.0.7f1
Issue ID
UUM-74679
Regression
Yes
PropertyField with range attribute triggers change event when the value didn't change
Reproduction steps:
1. Open the attached “BugRepro” project
2. In the Editor, navigate to Test > My Editor Window
3. Observe the Console window
Expected result: The change callback is called when the value is changed in the UI
Actual result: The change callback for the property with the Range attribute is called upon field creation even though the value didn't change.
Reproducible with: 2022.1.0a13, 2022.3.33f1, 6000.0.7f1
Not reproducible with: 2021.3.39f1, 2022.1.0a12
Reproducible on: Windows 11
Not reproducible on: No other environment tested
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
The Bind operation to the SerializedObject is done automatically, but is executed after the CreateGUI call, to allow users to create their UI fully before we bind it.
Binding a SerializedProperty to a field will always trigger a value change event, because the value is now coming from the serialized data and we need to inform users that this as changed, even if the value is the same. As a result, this value change after initialization of PropertyFields is expected. Still, we are planning to improve this in future versions.
A workaround to skip it is to schedule the registration to the next update like so: myPropertyField.schedule.Execute(/* registration */);