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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
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 */);