/// <summary> /// Horizontally align the ScrollRect to a RectTransform without scrolling past the edge of the content /// <param name="alignment"> 0 = left aligned, 1 = right aligned</param> /// </summary> public static void HorizontallyAlign(this ScrollRect scrollRect, RectTransform targetRectTransform, float alignment) { scrollRect.horizontalNormalizedPosition = scrollRect.CalculateHorizontalNormalizedPosition(targetRectTransform, alignment); }