Search Unity

UIElements questions and feedback

Discussion in 'UI Toolkit' started by Sangemdoko, Apr 3, 2019.

  1. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    No news at this time.
     
  2. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Will we have any visual way to create animation for UIElements or will it be possible only through code?

    I know that it's possible to write a separate tool for this to generate the required code (still would be nice for this to be embedded in the whole system), but I was wondering if there will be such a tool would it be generated code or some inside hidden thing like animation with keyframes?

    Also, the ability to create/write our own behaviours and movement for elements is very important in case default `Ease` and such are insufficient.
     
  3. PedroGV

    PedroGV

    Joined:
    Nov 1, 2010
    Posts:
    415
    Attributes will take this great feature to a whole new level. Hope to see it implemented soon
     
  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    We plan to start with CSS Transitions for the first phase of animation support, then move to exposing UI Toolkit to Unity's Timeline for more complex animations. But this will all come post 1.0 release now, in 2021. See:
    https://forum.unity.com/threads/ui-toolkit-1-0-preview-available.927822
     
    PixelLifetime likes this.
  5. dotsquid

    dotsquid

    Joined:
    Aug 11, 2016
    Posts:
    224
    a436t4ataf and Midiphony like this.
  6. Zagree

    Zagree

    Joined:
    Apr 20, 2021
    Posts:
    1
    :(
     
  7. Aldeminor

    Aldeminor

    Joined:
    May 3, 2014
    Posts:
    18
    Hi,
    I'm using custom UIElements-based inspector for all objects which just iterates over visible properties and spawns PropertyField (2021.3.17). But whenever I override that inspector to do custom stuff, I'm getting in a situation where various value fields (Enum, Object etc.) has label width different from the PropertyField's one. How can I quickly fix this without involving too much of code or pixel-guessing? Here's an example of EnumField (1) and two PropertyFields (2):
     

    Attached Files:

  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    You can fix this by adding the class ".unity-base-field__aligned" to the field.
    https://docs.unity3d.com/2023.2/Documentation/ScriptReference/UIElements.BaseField_1.html
     
    Aldeminor likes this.
  9. Aldeminor

    Aldeminor

    Joined:
    May 3, 2014
    Posts:
    18
    Thanks, it worked! But at first I just copied your string as-is and got nothing, that's because of the dot at the start, it shouldn't be there when passing the class name to the AddToClassList() :)

    BTW apparently in 2022.3 the alignment issue is gone.
     
    karl_jones likes this.