AssetReference Variable Asset Reference Type is tied to list position and will produce unexpected results when creating, duplicating or saving unset AssetReference Variables
Unity: UI Builder
Open
6.6.X
6.5.X
6.3.X
In Progress
6.7.X
Won't Fix
6.4.X
Unity 6000.4 has reached its end of life and will not receive further updates. If you need additional fixes, please upgrade to a newer Unity version.
Steps to reproduce:
Open any Project
Create a UIDocument Asset in the Project Browser and open it in UI Builder
In the StyleSheets panel create a new USS and select the :root selector
In the Inspector Variable list create an AssetReference Variable
Change the Variable's Asset Reference Type to any other than Texture
Right click the Variable and select "Duplicate"
OR
After step 3:
In the Inspector Variable list create an AssetReference Variable and change the Variable's Asset Reference Type to any other
Remove the Variable from the list
Add an AssetReference Variable to the list
Actual results:
Variable is duplicated as an AssetReference Variable but the Asset Reference Type defaults to Texture when no Asset Reference is set
When an AssetReference Variable Asset Reference type is changed for an item in one position of the list, the same Asset Reference type will be applied if another is created in it's place
Saving the USS file with unset Assets in AssetReference Variables will change their Types while the UI Builder Window is open
Changing AssetReference Types for unset Variables, then saving and reopening the UIDocument in UI Builder will default the Asset Reference Types to Texture
Expected results: Variables Asset Reference Type persists through duplication and does not default to the Asset Type that was previously set for a Variable in the same list position
Reproducible with versions: 6000.3.14f1, 6000.4.4f1, 6000.5.0b5, 6000.6.0a3
Can’t test with versions: 6000.0.73f1 (No Variables in selector)
Tested on (OS): Windows 11
Prioritise and Follow this issue
Have a workaround or additional info about this issue?