Complete the code to add a Vertical Layout Group component to the panel.
panelGameObject.AddComponent<[1]>();The VerticalLayoutGroup arranges child elements vertically inside the panel.
Complete the code to set the spacing between elements in a Horizontal Layout Group.
horizontalLayoutGroup.[1] = 10f;
The spacing property controls the space between child elements in the layout group.
Fix the error in the code to correctly add a Grid Layout Group and set cell size.
var grid = panel.AddComponent<[1]>(); grid.cellSize = new Vector2(100, 100);
The correct component name is GridLayoutGroup. Other names are invalid and cause errors.
Fill both blanks to create a panel with a Content Size Fitter and set it to adjust width.
var fitter = panel.AddComponent<[1]>(); fitter.[2] = ContentSizeFitter.FitMode.PreferredSize;
The ContentSizeFitter component adjusts the panel size. The horizontalFit property sets how width is adjusted.
Fill all three blanks to create a Grid Layout Group, set cell size, and spacing.
var grid = panel.AddComponent<[1]>(); grid.cellSize = new Vector2([2], [3]); grid.spacing = new Vector2(5, 5);
The GridLayoutGroup arranges elements in a grid. The cellSize is set with width and height values (100, 100).