Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2021.2.0a14
2021.2.0a17
Issue ID
1337191
Regression
Yes
UI Toolkit window text disappears and throw MissingReferenceException on reimport on Windows with Editor Font set to System Font
Steps to reproduce:
1. Create/Open any Unity project
2. Make sure "System Font" Editor Font is selected in Preferences
3. Open Window -> UI Toolkit -> Samples
4. Enter and exit Play Mode
Expected result: UI is rendered as expected, no errors are thrown
Actual result: Open UI Toolkit windows throw MissingReferenceException errors, UI becomes corrupted and text is not rendered
Reproduced with: 2021.2.0a17, 2021.2.0a14
Didn't reproduce on: 2021.2.0a13, 2021.1.8f1, 2020.3.9f1, 2019.4.27f1
Note: Only reproduced on Windows with System Font, all fonts on macOS work as expected.
Error:
MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object.get_name () (at <b603aff9c08241b8beccabaa6d7037b0>:0)
UnityEngine.UIElements.UIR.Implementation.UIRStylePainter.DrawTextCore (UnityEngine.UIElements.MeshGenerationContextUtils+TextParams textParams, UnityEngine.UIElements.ITextHandle handle, System.Single pixelsPerPoint) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIR.Implementation.UIRStylePainter.DrawText (UnityEngine.UIElements.MeshGenerationContextUtils+TextParams textParams, UnityEngine.UIElements.ITextHandle handle, System.Single pixelsPerPoint) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.MeshGenerationContextUtils.Text (UnityEngine.UIElements.MeshGenerationContext mgc, UnityEngine.UIElements.MeshGenerationContextUtils+TextParams textParams, UnityEngine.UIElements.ITextHandle handle, System.Single pixelsPerPoint) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.TextElement.OnGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.VisualElement.InvokeGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Add comment