Search Unity

Bug Outstanding defect with ChangeEvent<bool> not fixed for 2019.4 LTS - and it should be!

Discussion in 'UI Toolkit' started by wheee09, Jun 22, 2020.

  1. wheee09

    wheee09

    Joined:
    May 21, 2018
    Posts:
    68
    EDIT: you can ignore this - it looks like I misunderstood how the ChangeEvent worked - or more specifically what it worked on. It works on UI Control Elements rather than the serializable fields on an object (ScriptableObject/Monobehaviour). Therefore, if you don't have any actual UIElement control (eg. TextField, Toggle, etc) that is bound to the serializable field then even if the backing object changes, it won't fire this event.

    Seems like the accepted way is to create the controls and hide them (display: none) so that these events get fired properly.



    Sorry if I seem frustrated as wasting an hour on something only to discover that it was a defect can do that.

    Using ChangeEvent<bool> does not work and I found this:
    https://issuetracker.unity3d.com/is...egister-changeevent-callback-when-toggling-it

    It's been fixed for 2020.2 and has since been resolved.

    Something like that is pretty darn important and should be fixed for 2019.4 LTS and I'm frankly surprised that it wasn't.

    DISCLAIMER: I couldn't see the attached zip to that defect so I'm only assuming that it's talking about the same issue I'm encountering.
     
    Last edited: Jun 22, 2020