Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question Delayed adding visual elements to hierarchy causes strange behavior

Discussion in '2021.2 Beta' started by Llotar, Aug 26, 2021.

  1. Llotar

    Llotar

    Joined:
    Mar 27, 2016
    Posts:
    14
    Hello,
    In case of following flow :
    1. Create visual element + child elements
    2. Skip at least one frame (for example await Task.Delay(1))
    3. Add visual element to root

    One of 2 behaviors observed
    1. Events are no longer triggered until visual element is removed from hierarchy
    2. Some child elements might appear and after approx ~1s got disappeared. Switching display to none and then flex (from UI debugger)will make elements reappear and then again disappear

    Is it mandatory to create visual element and add it to hierarchy in same frame?