Search Issue Tracker
By Design
Votes
0
Found in [Package]
2020.3
2021.2
2021.2.10f1
2022.1
2022.2
Issue ID
1400734
Regression
No
UI Document can't be assigned to a property field in the Inspector
Reproduction steps:
1. Open the attached 'Test' project
2. Open the 'SampleScene'
3. Observe the 'Test' GameObject in the Inspector
4. Drag and drop the 'Test.uxml' UI Document from the Assets folder to the 'UI document' property of the 'Test Script' Component
Expected result: the 'Test.uxml' is assigned to the 'UI document' field
Actual result: the 'Test.uxml' can't be set to the 'UI document' field
Reproducible with: 1.0.0-preview.1 (2020.3.27f1), Built-in (2021.2.10f1, 2022.1.0b7, 2022.2.0a4)
Could not test with: 2019.4.35f1 (UI Toolkit is not available)
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:
UnityEngine.UIElements.UIDocument is the type for the UI Document scene component. The c# type corresponding to a uxml asset is UnityEngine.UIElements.VisualTreeAsset. Using this type in the supplied Monobehaviour will get the result wanted:
public class Test : MonoBehaviour
{
[SerializeField]
private VisualTreeAsset uiDocument;
[SerializeField]
private InputActionAsset inputActionAsset;
}