Search Issue Tracker
Fixed
Fixed in 2021.3.16f1, 2022.2.2f1, 2023.1.0a22
Votes
0
Found in
2021.3.6f1
2022.1.10f1
2022.2.0b3
2023.1.0a4
Issue ID
UUM-11196
Regression
No
UI Builder leaks "DefaultCommonDark_inter.uss" stylesheet into UI Documents
How to reproduce:
# Open the attached project (IN-5049.zip)
# Make sure “SampleScene” is open from the “Assets/Scenes” directory
# Observe the Game view and the text present in the UI panel on the left
# In the Project panel go to “Assets/GUI/Theme“ and open the ”base-theme” in a text editor
# Comment out lines 5 and 6 (starting with “{{-unity-font}}“ and “{{-unity-font-definition}}“ respectively)
# Return to the Editor and observe the Game view
Expected result: all text is rendered as it was before
Actual result: all the UI text is invisible
Reproducible with: 2021.3.6f1, 2022.1.10f1, 2022.2.0b3, 2023.1.0a4
Could not test with: 2020.3.37f1 (UI documents could not be loaded)
Reproducible on: MacOS 12.4, Ubuntu 20.04, Windows 10
Notes:
# Related forum thread: [https://forum.unity.com/threads/unity-ui-styles-leak-into-ui-builder.1285865/|https://forum.unity.com/threads/unity-ui-styles-leak-into-ui-builder.1285865/]
# The UI Builder interface leaks the “DefaultCommonDark_inter.uss” stylesheet into the user's UI Document making the representation in the UI Builder different from that of the Game view. The Editor font is leaked onto all elements when they won’t possess the fonts inherently and thus all text isn’t rendered in Game view.
# The issue appears to not be present when using a theme that inherits the “default.uss” stylesheet, however when you don’t, like in the attached project the issue becomes apparent.
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
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
- Metal Vertex Shader warning is being thrown when creating a VR Template Project
- Asset database warning is thrown when declaring font variable in the USS text file
Resolution Note (fix version 2022.2.2f1):
Fixed the old theme not being removed from the list of documentElement's stylesheet when changing the current theme.
Resolution Note (fix version 2021.3.16f1):
Ensure the old theme is removed from the list of stylesheets applied to the canvas when changing the current theme.