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