Eonirr

Untitled

Oct 26th, 2026
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. float topBorder = Screen.height - topMargin;
  2. float totalHeight = 0f;
  3. int totalOk = 0;
  4.  
  5. for (int j = 0; j < subtipColumns.Count - 1; j++)
  6. {
  7. int moved = 0;
  8. int step = 0;
  9. totalHeight = 0f;
  10.  
  11. while (step < subtipColumns[j].childCount)
  12. {
  13. totalHeight += heights[step + moved + totalOk] + margin;
  14. if (totalHeight > topBorder)
  15. {
  16. RectTransform rect = (RectTransform)subtipColumns[j].GetChild(step);
  17. rect.SetParent(subtipColumns[j + 1], false);
  18. moved++;
  19. }
  20. else
  21. {
  22. step++;
  23. }
  24. }
  25.  
  26. totalOk += step;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment