Search Unity

Feature Request Backport UIElements updates of 19.2 in 19.1

Discussion in 'UIElements' started by dzamani, Jun 10, 2019.

  1. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    82
    Hi,

    I would like to know if changes like the protection level of UIElements classes will be backport to 19.1 or not ? For example 'StyleProperty' or 'VisualElementAsset' ?

    I'm trying to see if I will be able to create a tool but I don't want to write the code twice or handle huge differences between 19.1 and 19.2 but I'm also trying to target the oldest Unity version I can that's why I'm trying to see if 19.1 is a good fit or not.

    Thanks!
     
  2. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    61
    Hello,

    As far as I know neither of the classes "StyleProperty" and "VisualElementAsset" are public and there protection level is still internal. As such I wouldn't recommend their use in any project as they may change without notice.

    In general we do not backport public APIs since those are related to new features.

    If you could give some context about what you want to achieve maybe I can provide more answers.

    Cheers
     
  3. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    82

    My bad, my question was pretty vague, I think the correct question to ask would be: is there any incompatibility when using UIElements on 19.1 and 19.2+ ?
    My question is based on the fact that some packages seems to not target 19.1 for some reasons and I was wondering why (the UIElements builder for example on staging).
     
  4. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    61
    The UI builder accesses internal functionality that only exists in 2019.2 and above, but for most users there will not incompatibilities between versions.

    Something rather big to expect is the refreshed Editor theme in 2019.3. We will publish an upgrade guide to help in this regard and also detail some small changes in the API and layout behaviour.
     
  5. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    82
    Do you think it's possible to develop a tool targeting the new theme but would still work on 19.1 ? Still my goal is to reduce duplicating code or handling soon to be dead API so it's more like looking for hints and clues for writing useful UIElements code without too much to refactor.
     
  6. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    61
    This will be definitely possible. Depending on much custom elements you have you may need to maintain two separate USS files that are loaded conditionally with
    #ifdef UNITY_2019_3_OR_NEWER
    .

    The API obsoletions will be very minor and will keep functioning (it will simply give a warning).

    Also I would recommend you trying out 2019.2 beta as we've added validation in the USS importer.
     
    dzamani likes this.
  7. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    82
    Building our tools on 19.2 may be what we will do.
    Thanks for all these answers!