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

Bug [2019.1.14f] binding-path for EnumField

Discussion in 'UI Toolkit' started by costeab, Jun 18, 2020.

  1. costeab

    costeab

    Joined:
    Apr 20, 2020
    Posts:
    10
    Hi,

    I'm using umxl to bind an enumfield to a custom enum. The enum field is part of an item in a ListView
    The values are displayed correctly however the object is not updated when I'm changing to a different value. The unity version that I'm using is 2019.1.14f.

    My code:
    Code (Xml):
    1.  <editor:EnumField binding-path="selectedType" class="h-control" value="Type1"  label="Type" type="Test.cType, Test.Enum" />
    The object behind has a public field: selectedTypeof type cType. If I omit the value attribute from the umxl I get an exception :

    Could not parse value of '', because it isn't defined in the Test.cType enum.
    UnityEngine.UIElements.VisualTreeAsset:CloneTree()

    Is this a bug or I'm doing something wrong. Let me know if you need more info.

    Thank you.
     
  2. stan-osipov

    stan-osipov

    Unity Technologies

    Joined:
    Feb 24, 2020
    Posts:
    31
    Hello, thx for reporting an issue, can you please share a sample project?
     
  3. costeab

    costeab

    Joined:
    Apr 20, 2020
    Posts:
    10
    Hi Stan,
    Thank you for the quick reply. I've uploaded the editor folder files.
     

    Attached Files:

  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,203
    Sorry for the delay. It does sound like a bug but it would be better to report it using Unity's Bug Reporter instead of the forum for proper tracking. However, this may have been fixed. Please try the latest 2019.4 LTS if possible to see if the issue still exist. We no longer support 2019.1, 2019.2, and 2019.3 (2019.3 has converted to 2019.4 LTS).
     
  5. costeab

    costeab

    Joined:
    Apr 20, 2020
    Posts:
    10
    Thank you Damian. Meanwhile we moved to 2019.4 and indeed is ok now. At the time it looked like we are stuck to that version.