I want to make an UI panel with dynamic content. Parts of the UI will come and go and the main window should account for the size change.
My main window has a VerticalLayoutGroup
and ContentFitter
components, and all the children has a LayoutElement
component with the PreferredSize
set to some values. The idea was to animate the components by slowly changing the Y-scale of the RectTransform
from 1 to 0 when the UI elements should disappear and back to reappear. The problem is, the UI elements do scale, but the layout system doesn’t account for that and still allocates the full PreferredSize in the main window.
Is there a way around it?