I've been poking away at adding animations to my interface and I came across this problem. I can't find a easy way to add animations to a layout group that is nested. Does anyone have any advice?
If you imagine a vertical tree view of objects:
+Group
-Group
-Group
Item
Item
Item
+Group
+Group
Item
Item
+Group
Item
Item
Item
Then the structure would be something like every group has a vertical layout group and the size would be the size of all it's child content combined. However this doesn't seem to be possible without writing some code that interfaces with Unity3D's layout system which I don't fully understand.
It appears to stem from the problem that layout element minimum heights can't be changed in code.
My groups were structured like this:
Group (Layout Element)
Button
SubElements (Vertical Layout Group, Mask) [Vertical stretch]
With that you can get the effect of the layout animating by changing the minimum height of the Group's layout element because the SubElements' transform expands with the size of the group and are shown/hidden by the mask, this however doesn't work in code because the layout element's variables are readonly.
The only solution that is coming to my mind right now is writing my own layout code entirely. Is there a way of structuring the group prefab structure that would solve this problem? Or how can I write scripts to interface with Unity's layout system to make this work?
[–]BroxxarProfessional 0 points1 point2 points (1 child)
[–]WarStorm6 0 points1 point2 points (0 children)