Search Unity

Feedback Animator with 1-frame anim are invalidating the frame

Discussion in 'UGUI & TextMesh Pro' started by gsylvain, Feb 16, 2021.

  1. gsylvain

    gsylvain

    Joined:
    Aug 6, 2014
    Posts:
    104
    Just a feedback here. I often read optimization guides saying that having some one-frame animation on UI elements is consistently re-writing its data, thus invalidating the UI and forcing a layout rebuild.

    I know that it is possible to sort of bypass this "issue" by adding a custom AnimatorStateBehaviour on the animator's node that contains the one-frame animation and deactivating the animator when reaching it. This is far from elegant and may introduce errors because we have to manually detect when to re-enable the animator.

    My feedback is: would it be possible to expose a "write once" checkbox somewhere that would only apply the one-frame animation data once and never do it again while it stays in that state?

    Thank you