Пример #1
0
 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);
     }
 }
Пример #2
0
 private void RedirectEvent <T>(Action <T> action) where T : IEventSystemHandler
 {
     if (redirectConstrained)
     {
         foreach (var component in redirectConstrained.GetComponents <T>())
         {
             action(component);
         }
     }
 }
Пример #3
0
 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>();
 }