Unity Issue Tracker - Math assignment operators done in a numeric field don't return the expression result
Fixed
UUM-3471
Math assignment operators done in a numeric field don't return the expression result
Unity: UI Toolkit Controls
UIToolkit
Fixed
2023.1.X
2022.2.X
2021.3.X
Won't Fix
2022.1.X
Fixed in 2023.1.0a24
Fixed support for compound assignment operators for UI Toolkit numeric fields (IntegerField, LongField, FloatField, DoubleField)
Port canceled as we transition to 2022.2 (2022.2.X port is active or already resolved)
Fixed support for compound assignment operators for UI Toolkit numeric fields (IntegerField, LongField, FloatField, DoubleField).
How to reproduce:
1. Open the user's attached "repro UIToolkit" project
2. Open the "SampleScene" Scene
3. Select the "Test" GameObject in the Hierarchy
4. Enter "/=5" assignment operator in the "Test (Component) -> UI Toolkit -> X" numeric field in the Inspector
Expected result: "UI Toolkit -> X" field value is set to 1 (the division expression result)
Actual result: The expression result is 0 when a multiplication-related assignment operator is passed, or the addend if sum-related
Reproducible with: 2021.3.0f1, 2022.1.0b16, 2022.2.0a10
Couldn't test with: 2019.4.37f1, 2020.3.33f1 (the '=' symbol isn't writable in the numeric fields)
Note: The bug isn't reproducible with IMGUI fields with some versions. The Expected result can be observed in the not reproducible versions of case 1399184
Prioritise and Follow this issue
Have a workaround or additional info about this issue?