Search Issue Tracker
Fixed in 2022.1.X
Duplicate in 2021.3.X
Changes in UI Builder are lost when editing a 2D sprite
How to reproduce
- Make a change in the UI Builder (such as changing text size/colour)
- Click on a 2d sprite and click on the sprite editor button in the inspector
- Make a change to the 2d sprite and click close
*You are now presented with a dialog box stating that you will lose any unsaved changes in UI Builder.
Either changes are not lost or on opening the sprite editor the user is warned about the potential for data loss and is allowed to save any unsaved work.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Long Prefab save times when using Unity 2022.2 and higher
- Console displays error "UnityException: Creating asset at path Assets/Scenes/ .scenetemplate failed." during scene template saving
- "Development Build" watermark is shown in non-development UWP release builds
- Console errors appear when the Inspector is set to Debug and a GameObject is selected
- A script public variable value is not used when set in the Inspector window
Resolution Note (fix version 2022.1):
This behavior is unfortunately as designed. The UI Builder relies on the AssetDatabase to react to external changes on any of the assets in use -- including dependents. One the assets that the current UI document (aka uxml) depends on, let's say a sprite, has been modified externally (because the Sprite Editor is external in this use case), and so the uxml was automatically reimported by the editor -- and it is then, and only then, that the Builder is made aware of the external change. The changes that were made locally are then automatically lost and the Builder can only warn the user that this happened.
This way of working with assets (using the AssetDatabase) allows the user to see any changes made in the Builder directly in the Game View (live editing) but has the disadvantage of putting the Builder in the "back seat" and has no control over incoming changes from an external source.
The one thing we could do is update the message that is being sent to the user -- make it a bit gentler -- but other than that I am afraid there is nothing more we can do.