public static void ScrollToTopRect(this ScrollRect goScrollRect) { ScrollRect[] scrollRects = goScrollRect.GetComponents <ScrollRect>(); foreach (ScrollRect scroll in scrollRects) { scroll.GetComponent <ScrollRect>().normalizedPosition = new Vector2(0, 1); } }
private void RedirectEvent <T>(Action <T> action) where T : IEventSystemHandler { if (redirectConstrained) { foreach (var component in redirectConstrained.GetComponents <T>()) { action(component); } } }
void Start() { _beginDragHandlers = ParentScrollRect.GetComponents <IBeginDragHandler>(); _dragHandlers = ParentScrollRect.GetComponents <IDragHandler>(); _endDragHandlers = ParentScrollRect.GetComponents <IEndDragHandler>(); }
private void AssignScrollRectHandlers() { _beginDragHandlers = ParentScrollRect.GetComponents <IBeginDragHandler>(); _dragHandlers = ParentScrollRect.GetComponents <IDragHandler>(); _endDragHandlers = ParentScrollRect.GetComponents <IEndDragHandler>(); }