Search Unity

[UIElements] Rebuild project when UXML file changes

Discussion in 'UI Toolkit' started by InScatterbrain, May 11, 2019.

  1. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    234
    I've been using UIElements for a bit now and I must say it's been a good experience so far. :)

    One small thing that's bothering me though, is that changing a UXML file, doesn't seem to trigger a rebuild of the project. Is there a way to make Unity rebuild whenever a UXML file has been changed?
     
  2. patrickf

    patrickf

    Unity Technologies

    Joined:
    Oct 24, 2016
    Posts:
    57
    Hi! Thank you for your feedback!

    In order for UXML changes to take effect, you need to close and reopen the window. Automatic reloading is on our todo list.
     
  3. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    234
    Good to know. Thanks!
     
  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Pressing F5 while the Window is focused might also do the trick. There's a Reload Window in the top right window menu.
     
  5. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    234
    Closing and opening the window works, but pressing F5 doesn't seem to do anything, also can't find the Reload Window option.
    upload_2019-5-15_15-55-50.png

    I'm on version 2019.2.0.1b
     
  6. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Ah, I keep forgetting that's only for Developer Mode (Edit > Preferences > General). I just always have it enabled. :)
     
  7. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    234
    Oh ok, I wasn't aware of the existence of developer mode! Also, can't find it though. ;) Am I missing something?

    upload_2019-5-17_10-48-4.png
     
  8. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Hmm.. maybe it wasn't there in 2019.1. If you go to Help > About Unity and, with the About window focused, type: "internal" (yes, blindly) you will turn Unity dev mode on (type it again to turn it off).
     
    Mrbeardy likes this.
  9. InScatterbrain

    InScatterbrain

    Joined:
    Mar 7, 2017
    Posts:
    234
    That did the trick! I feel like I activated some kind of cheat mode. :D

    Thanks, being able to reload windows like that will be very useful. :)