Search Issue Tracker
By Design
Votes
2
Found in [Package]
Built-in
Issue ID
1389391
Regression
No
[UI Toolkit] Style changes applied with USS are overridden when the style is set through a script
How to reproduce:
1. Open the attached project "tint repro"
2. Open the scene "SampleScene" and enter Play mode (Assets/Scenes/SampleScene.unity)
3. In the Game view, click the red checkmark
Expected result: The checkmark color is tinted green
Actual result: The checkmark color remains red
Reproducible with: 1.0.0-preview.15, 1.0.0-preview.17 (2020.3.31f1), Built-in (2021.2.16f1, 2022.1.0b12, 2022.2.0a8)
Could not test with: 2019.4.36f1 (No UI Toolkit), 1.0.0-preview.14 (2020.3.31f1) ('DefaultEditorWindowBackend' does not implement interface member 'IEditorWindowBackend.overlayGUIHandler')
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
- GetCurrentAnimatorClipInfoCount() and GetNextAnimatorClipInfoCount() return 0 when animator is in transition
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
Resolution Note:
The Image component does not offer a way to unset style overrides made directly on the instance, in C#.
Unfortunately this limitation is common to all custom style properties in UI Toolkit.
We intend to revisit this functionality at a later date but we have decided to mark this issue "Won't fix" in the meantime.
A workaround is discussed in the forum thread: https://forum.unity.com/threads/inherit-image-tint-color.1211376/