Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int j = 0; j < subtipColumns.Count - 1; j++)
- {
- totalHeight = 0f;
- int moved = 0;
- int i = 0;
- while (i < subtipColumns[j].childCount)
- {
- RectTransform rect = (RectTransform)subtipColumns[j].GetChild(i);
- totalHeight += rect.rect.height + margin;
- if (totalHeight > topBorder)
- {
- rect.SetParent(subtipColumns[j + 1], false);
- rect.SetSiblingIndex(moved++);
- }
- else
- {
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment