Runtime parsing of uxml, uss

This has been a question before, and the answer has often been “maybe in the future”, so I’m asking again.

Essentially, is there any plans around supporting parsing of uxml and uss at runtime? The typical use case would be something like fetching in-game update notifications like a lot of games have in the main menu, without having to deal with the complexity overhead of packing stuff into Asset Bundles. I can also imagine fairly interesting reflection-like usecases for building UI stuff on the fly.

I understand that this would incur a non-trivial performance cost to use, but we can work around and/or live with those. I think the value of this would far outweigh the downsides.

“Maybe in the future” is still the current official answer. :slight_smile:

However, we are working towards it. We want to open up the APIs for both VisualTreeAsset and StyleSheet so that they can be used through code without needing to go through the .uxml and .uss asset importers. This alone should open up a lot of possibilities.

The main blocker for exposing the parsing of .uxml and .uss files at runtime is the amount of editor-only code the parsing currently uses. Some of them are on us and we can slowly migrate them to be runtime compatible, but we are using a lot of AssetDatabase APIs around assets which will be harder to migrate.

4 Likes