Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request UI Builder should reload UXML from disk after it was edited manually

Discussion in 'UI Toolkit' started by Xarbrough, Dec 1, 2019.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I'm trying out the UI Builder and noticed that it does not show all builtin control types in the library panel yet. For example, Toolbar, ToolbarButton, etc. are missing. Luckily, I can add these manually to the UXML and the builder will correctly display and use these elements. So far I believe it's alright to experiment with features in this way until all features are supported via the interface.

    However, once the UI Builder window has opened the UXML file for the first time after starting Unity, it seems to create a copy in memory or some persistent cache. Now, if I edit the UXML text file in my text editor, save, refresh assets and try to re-open the file with the builder, it still shows the old version. The changes are present in the UXML text file on disk, but the builder shows a previous version. I tried entering play mode, refreshing, reimporting the UXML and closing/reopening the file via the builder, but nothing helped until I restarted Unity. After Unity was closed and reopened, the builder correctly loaded the file from disk again.

    Would it be possible to force a load from disk for my use-case? It doesn't have to be automatic, it would be fine to select File > Open and pick the file again, but then it should load the actual text file and not a cached version. This would help me experimenting with the builder, especially now in the early phase were not all features of UXML are exposed oder supported via the interface. Thank you!
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Toolbar and other built-in controls will be added soon to the default Unity list of controls. In the mean time, you can create Toolbar controls in the Builder, but for now you have to enable Developer Mode in Unity. Go to the Help > About window of Unity and just type "internal". Now, in the Library pane of the UI Builder you should see a UnityEditor entry in the Project section which will contain the Toolbar controls.

    This is currently a tracked bug we hope to fix soon. In the meantime, the best way to "reload" an asset is to load another UXML file (or just go to the Viewport > File > New inside the UI Builder window) and then reload the UXML you just modified externally.
     
    Last edited: Dec 9, 2019
    StephanieRowlinson and Xarbrough like this.