When one deletes a uss file ideally I’d expect a warning or a non-breaking error message. At the very least the UI Builder should not fail and we should be able to resolve the issue in the editor, not only in the text editor.
In 2023 there seems to be an empty StyleSheet in the UI Builder but only while the affected file is open in it. If I freshly open it then there is no missing USS file shown and I have to resolve this in a text editor.
I believe there must be a missing style sheet and a way to resolve it, hence delete it in Editor.
Also why is there no drag n drop for StyleSheets? Like nearly everything in Unity works with D&D and null references but this one breaks the rules.
1 Like
Equally annoying is if I move my theme file to a different locaition all of the USS linked to it break because they’re absolute paths.
Same occurs if I move any USS that’s referenced by the theme, it makes refactoring and adjusting a project incredibly tedious and long winded.
By default they seem to include the GUID next to the path and then this works without an issue, I just tested it in 2022.3. Of course you have to move files within Unity / with the .meta file. The same is true for image references.
In my theme file (.tss) its just paths. I’ve made them relative but otherwise just absolute paths without any guids. Not sure if I need to do anything special for it to reference the guids.
@import url("../Systems/Modules/OptionModule/USS/options/option-label-style.uss");
@import url("../Systems/Modules/OptionModule/USS/options/option-button-style.uss");
So I tried moving a style that’s referenced here and as expected it breaks and the reference is lost.
1 Like
I didn’t know that themes exist lol, I am more or less getting started with UITK. That is of course not ideal but is what we are known from web development so it is not htat much of an annoyance to me, I guess. Alternatively they could add guid(…) as an alternative to url or simply allow a GUID to be pasted.
Hi!
I agree with you that the UI Builder should not just fail with your use case. May you please file a bug for it?