Hello, I've been working on a custom google material-like UI framework for Unity and I'm struggling to become friends with layouts. I've been using them mostly for Scaffold, Card, and Table components.
Upfront, they work fine, but when it comes to GameObjects being inactive, controlling child sizes has that odd delay of recalculating after the activeSelf property is set to true. This is mainly a problem for my Tables because I calculate column width's based on the Table's header width, which seems to be set to 0 unless the game object is already active.
In my loadout, I have a table (SkillEffectTableView) inside of a card with a vertical layout group.
For the main child components of the table (header, body, and footer), I use elements to calculate the preferred heights. I do this since I want the body to be expanded if I had the footer/paginator disabled. BUT, since this card may be disabled initially, all the heights are set to 0.
The problem isn't my layout configuration, it's my lack of understanding of when the layouts are calculated. Perhaps I can utilize a callback or some way ensuring all the layouts are calculated before using any of the respective rects.
Any advice? The parent Card uses the same Header-Body-Footer layout system with the same semantics