Search Unity

Asset References in Uxml files

Discussion in 'UI Toolkit' started by MaskedMouse, Jan 14, 2021.

  1. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I've been busy creating editor tools with the UI Builder. However I run into the problem that whenever I have a Vector image linked to a VisualElement and afterwards rename the folder or move the Vector file into another folder, that the uxml loses the reference. This is because it is an relative path to the file.

    Is there a way these references can be made without relative urls? for example AssetDatabase GUIDs?
    I know I can load them in C# as well using the AssetDatase. But then the icon is hard coded.
    It would be nice to have a non-relative path and non-hard coded solution for this.
     
    achimmihca likes this.
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Unfortunately the only way to reference it is by path, but we do have it on our plans to use GUIDs eventually - just not sure when it's coming yet.
     
    MaskedMouse likes this.