void SetLayout(FlexLayoutData data, float factor) { SetLayoutElementSize(data, factor); RectOffset rectOffset = GetPadding(data, factor); layoutGroup.padding = rectOffset; layoutGroup.childAlignment = data.alignment; }
private static RectOffset GetPadding(FlexLayoutData data, float factor) { RectOffset rectOffset = new RectOffset(); rectOffset.top = (int)(data.padding.top * factor); rectOffset.bottom = (int)(data.padding.bottom * factor); rectOffset.left = (int)(data.padding.left * factor); rectOffset.right = (int)(data.padding.right * factor); return(rectOffset); }
private void SetLayoutElementSize(FlexLayoutData data, float factor) { firstChild.preferredWidth = data.preferedFistChildSize * factor; secondChild.preferredWidth = data.preferedSecondChildSize * factor; thirdChild.preferredWidth = data.preferedThirdChildSize * factor; }