I am currently working to create an inventory system that contains multiple categories, each of which houses its own inventory slots. I have constructed a vertical layout group to do this, with the category headers as child gameobjects of the vertical layout group.
As you can see, this is working just fine. The number of categories is to change dynamically, with item slots able to be collapsed and uncollapsed with the little arrow at the side. I have the item slots showing up as intended.
The issue arises when I try to add a second category...
The vertical layout group does not recognize the item slots (which are currently housed as a child object of the category header) as part of the original object, and thus does not adjust other child objects around them. I have tried to use a content size filter, but this feature does not work for child objects of layout groups.
I have tried everything I can think of. While I could code this statically, so that everything moves a preset amount, I need everything in this system to be dynamic, including number of categories and the number of item slots per category.
Here is my hierarchy setup for this system (everything here is a child of the scroll view, if it helps.)
Thank you! I understand that this is a complicated issue, but I have tried every solution I can think of, and this time, Unity has bested me.