Search Issue Tracker
Fixed
Votes
0
Found in
2022.3.56f1
6000.0.35f1
6000.1.0b2
Issue ID
UUM-92945
Regression
No
Forced to lose unsaved UI Builder changes if edit was made in .uss file
Steps to reproduce:
- Create a new URP project.
- Assets > Create > UI Toolkit > UI Document.
- Open this in UI Builder. Under StyleSheets, press + > Create new USS.
- Add multiple things to the Hierarchy, make changes, but don't save.
- User thought: "Oh, I'd like to create a variable to use with my UI. Let's open (the USS made in Step 3) and add one."
* Open the USS in an IDE/text editor and add:
{code:java}
:root {
--color-1: blue;
--color-2: yellow;
}{code}
To the USS file you created in Step 3. Save your file.
6. User thought:* "Let's put this variable into the UI Builder"
*
* Return to the editor.
Actual results:* A warning pops up that the .uxml was changed outside of the UI Builder with the following description.
{code:java}
The UI Builder will now apply the changes made outside of the UI Builder. This overwrites any unsaved changes you made in the UI Builder.
Note: To avoid conflicting changes, make sure to save any changes you make in the UI Builder before editing a file in an external editor or in a dedicated editor inside Unity (this includes resource files like Font and Sprite assets which have their own editor).
{code}
- (!) The user can only press OK, or X, +both of which lead to all unsaved changes being wiped away.+
Expected results:
As the user, I only wanted to add a USS variable, or edit the USS variable to slightly tweak the UI. If this had to happen, I would have much rathered:
- An option to save UI Builder changes first.
- An option to undo my USS change, which when discovering this issue was just me editing a value from 36px -> 28px. This would have been a much less painful loss of data.
- A choice on which to keep.
Being told there is no option but to lose the UXML changes while those changes are still visible in the background was quite sad.
Reproducible with versions:
- 6000.1.0b2, 6000.0.35f1, 2022.3.56f1, 2022.2.0a17
Tested on (OS): Windows 10
Notes:
- Editing the USS seems to be the only way to add variables at the moment. The documentation tells you that you need to add them in a text editor: [https://docs.unity3d.com/6000.0/Documentation/Manual/UIB-styling-ui-using-uss-variables.html]
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
- Palette Settings link to the documentation isn’t working
- Tags & Layers window has inconsistent remove button behaviour between Tags, Sorting Layers, and Rendering Layers when there are no removable items in the list
- "Type Options" and "Node Library" dropdowns do not open when clicked on the title
- Public char variables uneditable in Inspector when project setting "Use IMGUI Default Inspector" is enabled
- IAP Listener component’s list titles go out of bounds when resizing the Inspector window horizontally
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-76252