//IBeginDragHandler public void OnBeginDrag(PointerEventData eventData) { //Get the absolute values of the x and y differences so we can see which one is bigger and scroll the other scroll rect accordingly float horizontal = Mathf.Abs(eventData.position.x - eventData.pressPosition.x); float vertical = Mathf.Abs(eventData.position.y - eventData.pressPosition.y); if (scrollOtherHorizontally) { if (horizontal > vertical) { scrollOther = true; //disable the current scroll rect so it doesnt move. _myScrollRect.enabled = false; ParentScrollRect.OnBeginDrag(eventData); ParentScrollSnap.OnBeginDrag(eventData); } } else if (vertical > horizontal) { scrollOther = true; //disable the current scroll rect so it doesnt move. _myScrollRect.enabled = false; ParentScrollRect.OnBeginDrag(eventData); ParentScrollSnap.OnBeginDrag(eventData); } }
static public int OnBeginDrag(IntPtr l) { try { UnityEngine.UI.Extensions.ScrollSnap self = (UnityEngine.UI.Extensions.ScrollSnap)checkSelf(l); UnityEngine.EventSystems.PointerEventData a1; checkType(l, 2, out a1); self.OnBeginDrag(a1); return(0); } catch (Exception e) { return(error(l, e)); } }