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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Create Large Object Field at UI Builder

Discussion in 'UI Toolkit' started by FilipeHipolito, Jan 17, 2023.

  1. FilipeHipolito

    FilipeHipolito

    Joined:
    Oct 7, 2019
    Posts:
    4
    Hi! Is there any way to create a Object Field where I can preview the selected asset as we did with EditorGUILayout.ObjectField passing typeof(Sprite)? Like in the image bellow.




    Or do I need to create it by code and can't do this using the editor?
     
  2. FilipeHipolito

    FilipeHipolito

    Joined:
    Oct 7, 2019
    Posts:
    4
    The best I could do here was to use an object field and setting a visual element background by code. Just scaling the object field doesn't do the trick.

    upload_2023-1-17_16-53-13.png upload_2023-1-17_16-54-41.png
     
  3. cpalma-unity

    cpalma-unity

    Unity Technologies

    Joined:
    Nov 30, 2020
    Posts:
    90
    Hello! Right now there is no way to have a large object field. We are aware of this problem and it should be addressed soon. We are actively working on bringing parity between IMGUI and UI Toolkit :)
     
    FilipeHipolito likes this.
  4. kaarlagd

    kaarlagd

    Joined:
    Jan 3, 2021
    Posts:
    1
    Could you share the USS? I can not figure out how to write the uss to do this :D