Search Unity

Question Tween for UI Builder

Discussion in 'UI Toolkit' started by NymoBasepro, Sep 9, 2020.

  1. NymoBasepro

    NymoBasepro

    Joined:
    Apr 28, 2018
    Posts:
    26
    Hi there,

    Is there already a Tween possibility with UI Builder?
    And can you point to some ducumentation?

    With kind regards, Nymo
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    Hello, there's no tween integrated with the UI Builder at this moment, but there is a tweening API under the Experimental namespace (UnityEngine.UIElements.Experimental) you can take a look at :)

    This sample uses the API I mentioned in a few places, but especially on the End Screen.
     
  3. NymoBasepro

    NymoBasepro

    Joined:
    Apr 28, 2018
    Posts:
    26
    Hi Julia, thanks for the reply.

    I downloaded the project and what I think I saw is (and also some questions :)) :

    #1. There is a begin style, and an end style, and unity will lerp between the two styles during the duration time in milliseconds. Correct?

    #2. And because it is a MonoBehaviour, is it possible to do this with update? (not necessary of course).

    #3. Will (or is) it be possible to just point to two definitions in an uss file for the styles?
    .BeginStyle{
    --some uss
    }
    .EndStyle{
    --some other uss
    }

    #4. Will there be a rotation possibility? (so after looking at some "Start" overloads, I see an Quaternion input, let's see what that does ;))

    #5. Is it possible to work with layer orders and order in layers?

    #6. Will it be possible for the community to add to the existing uss behaviours?

    Okay enough for now ;)
    This is gonna be fun! I think when the rotation is added, we can already start converting tween functionality to the new and professional workflow! I'm excited.

    with kind regards,
    Nymo
     
    Last edited: Sep 11, 2020
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    Hello again!

    #1 is accurate, however this is not done to the MonoBehaviour itself so it's not the UIDocument that is moving/rotating/whatever, it's the VisualElements so no, you don't do that with update (#2). Also, the styles used here are not exactly the USS style sheet classes so it's not possible to do it as #3 (also #6 does not apply in this case).

    Yes, you can animate rotation (#4).

    Not sure we have the same concept of layers (#5) but you can order panels by setting the sorting order on the PanelSettings asset - is that what you mean? Unrelated to animations, though.

    Keep in mind this is still in experimental! We plan on improving the API eventually and if you have specific feedback about it we would welcome that greatly :D
     
  5. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
  6. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    Hello! The state of animations hasn't yet changed, as we still have the experimental namespace with the basic animation API. However, USS animations are coming for 2021.2 and we're actively working on that part right now.

    Is there any specific question you have @Nicokam ?
     
  7. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
    Yes, what I meant to ask (by this and the other post thread) is if there is a prediction on when all functionalities will be implemented and when it will become production ready!
     
  8. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    I'm not sure what you call "production ready". UI Toolkit for Runtime will be an official feature starting 2021.2, but we are aware it is not completely up to par with UGUI for example. Depending on what you need you may not be able to use UI Toolkit, so if I were you I'd check your requirements against the current capabilities.
     
  9. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
    Ok. Thanks!