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 Overriding templates images

Discussion in 'UI Toolkit' started by Eldirfar, Sep 14, 2022.

  1. Eldirfar

    Eldirfar

    Joined:
    Feb 9, 2014
    Posts:
    58
    Hello,
    I started my journey with UI Toolkit for runtime and I have a few problems or questions.

    Is it possible to override any property inside ui builder? I have a template for the button and I want to change their images. I tried to do this by adding <AttributeOverrides> but the image is inside style I guess.

    This is a pure prefab approach which I used with an old Unity UI system. Or there is another way of doing this?


    upload_2022-9-14_19-29-17.png
     
  2. frankcarey

    frankcarey

    Joined:
    Jul 15, 2014
    Posts:
    14
    Starting to work with this and found that you can edit the uss file..


    Code (CSharp):
    1. #bottom-bar-button-clans .icon-class {
    2.   background-image: url('project://database/Assets/...
    3. }
     
  3. Eldirfar

    Eldirfar

    Joined:
    Feb 9, 2014
    Posts:
    58
    Thanks, overriding uss is working. I'm not very familiar with uss so I need to learn much about styling.