Beispiel #1
0
 static void SetDynamicVerticalLayout(VerticalLayoutGroup layout, VerticalLayoutDynamicDirection direction)
 {
     layout.childAlignment = direction == VerticalLayoutDynamicDirection.Top ? TextAnchor.UpperCenter : TextAnchor.LowerCenter;
     layout.spacing        = 5;
     layout.GetOrAddComponent <ContentSizeFitter>().verticalFit = ContentSizeFitter.FitMode.MinSize;
     layout.GetComponent <RectTransform>().pivot = direction == VerticalLayoutDynamicDirection.Top ? new Vector2(0, 1) : new Vector2(0, 0);
 }