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. Dismiss Notice

Bug Incorrect output of UxmlAttribute

Discussion in 'UI Toolkit' started by Hellfim, May 21, 2023.

  1. Hellfim

    Hellfim

    Joined:
    Sep 11, 2014
    Posts:
    91
    I've started using UxmlAttribute and it's great. However using UxmlAttribute on floats provides an unexpected behaviour: value of "0.25" from UI Builder is being written as "0,25"
    I believe this happens because serialization uses local culture (e.g. floating point separator is ',' (comma) instead of '.' dot). I suggest you use InvariantCulture for all conversions, but that's up to you to decide :)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Hi,
    What version of unity are you using?
     
  3. Hellfim

    Hellfim

    Joined:
    Sep 11, 2014
    Posts:
    91
    I'm using Unity 2023.2.0a15
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Thanks. I see where the issue is, ill get it fixed.
     
    GDevTeam and Hellfim like this.