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 Addressables and UIElements

Discussion in 'UI Toolkit' started by spaceoddity-carlos, Jun 12, 2022.

  1. spaceoddity-carlos

    spaceoddity-carlos

    Joined:
    Jun 12, 2022
    Posts:
    1
    Hi, I'm trying to figure out how to make Addressables and .uss / UIElements work together.

    Is it possible at all to reference an addressable asset path when styling with .uss (or any other way related to UIElements)?

    Code (CSharp):
    1. /* currently */
    2. -unity-font: url('project://fixed/asset/path');
    3.  
    4. /* what i'm asking */
    5. -unity-font: url(<addressable key?>);
    I've googled and couldn't find anything related to this.
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    That's currently not supported, but you can up vote it on our roadmap! Look for "Addressable Asset System support" on the UI Design roadmap :)
     
    Last edited: Jun 21, 2023
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    But if I just put ui runtime prefab created by ui toolkit into addressables is ok right?
     
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Yes, you can add UI Toolkit assets into Addressables and refer to them from there, you just can't add Addressable assets on USS/UXML files at this time.
     
    Midiphony-panda and optimise like this.
  5. Unitiblis

    Unitiblis

    Joined:
    Aug 7, 2018
    Posts:
    13
    @JuliaP_Unity just to clarify: Referencing the AssetPath to a Sprite which is part of an Addressable SpriteAtlas does work via Late-Binding, right?
    Works in Editor at least, but did not test it in a 'final' build yet.
     
  6. SamuelAsherRivello

    SamuelAsherRivello

    Joined:
    Jan 16, 2011
    Posts:
    36
    Here is the updated link to vote. I googled for it.

    https://unity.com/roadmap/unity-platform/ui
     
    Last edited: Jun 21, 2023
  7. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    The link changed not too long ago, thanks for posting it again here and I also updated my original comment to avoid confusion :)