Search Unity

Bug Name attribute override stopped working

Discussion in 'UI Toolkit' started by Onigiri, Dec 29, 2020.

  1. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    I just updated to the latest UIToolkit version and i can see that <AttributeOverrides> can't override name of the instantiated UXML anymore. This is worked fine in older version. Is this a bug or why can't we do this anymore?
     
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
  3. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Hello,

    This was changed on purpose. The problem is that the name of an element is used to find its overrides. Allowing its name to be changed could lead to unexpected results depending on the order in which overrides are applied.

    This should give a clear warning when the UXML is imported.
     
  4. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    Good to know, thanks.