Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Is there a way to prevent UI Builder to overwrite USS files?

Discussion in 'UI Toolkit' started by vejab, Aug 2, 2022.

  1. vejab

    vejab

    Joined:
    Dec 21, 2021
    Posts:
    85
    Maybe I'm working the wrong way but often when I edit a UXML file in UI Builder and a USS file in Rider at the same time, I end up saving in UI Builder and it erases some changes in the USS file. I never use UI Builder to write USS but I still want the uss file to be linked in the ui builder.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,842
    You probably want to make sure you A: Save in Rider, and then B: make sure the asset database refreshes. Usually with CRTL-R.
     
  3. vejab

    vejab

    Joined:
    Dec 21, 2021
    Posts:
    85
    Rider saves automatically so there shouldn't be any issue but sometimes there is.
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,842
    Yes, but has Unity refreshed it's asset database before you save in the UI builder?

    If Unity still has an old version loaded it will probably then overwrite your changes in Rider.
     
  5. vejab

    vejab

    Joined:
    Dec 21, 2021
    Posts:
    85
    If I modify the USS file, then I modify the UXML file in UI builder without ctrl+R in between, I'm screwed. The issue is that I'm too careless to really pay attention. I'd prefer being able to prevent UI Builder from writing USS code this it's a feature I don't use anyway. Maybe there is a way in Rider to prevent external modifications, I'll check this later.
    Otherwise, I guess I'll have to take up the habit to ctrl+R before modifying things in the builder.
    Thanks