Inheritance: MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler
示例#1
0
        void Start()
        {
            //ww COSTUMIZED :: Get the current scroll rect so we can disable it if the other one is scrolling
            if (ParentScrollRect == null)
            {
                ParentScrollRect = ParentScrollObj.GetComponent <ScrollRect>();
            }

            if (ParentScrollObj.GetComponent <HorizontalScrollSnap>() != null)
            {
                scriptParent = ParentScrollObj.GetComponent <HorizontalScrollSnap>();
            }

            //Get the current scroll rect so we can disable it if the other one is scrolling
            _myScrollRect = this.GetComponent <ScrollRect>();
            //If the current scroll Rect has the vertical checked then the other one will be scrolling horizontally.
            scrollOtherHorizontally = _myScrollRect.vertical;
            //Check some attributes to let the user know if this wont work as expected
            if (scrollOtherHorizontally)
            {
                if (_myScrollRect.horizontal)
                {
                    Debug.Log("You have added the SecondScrollRect to a scroll view that already has both directions selected");
                }
                if (!ParentScrollRect.horizontal)
                {
                    Debug.Log("The other scroll rect doesnt support scrolling horizontally");
                }
            }
            else if (!ParentScrollRect.vertical)
            {
                Debug.Log("The other scroll rect doesnt support scrolling vertically");
            }
        }
示例#2
0
 static public int get_FastSwipeThreshold(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         pushValue(l, self.FastSwipeThreshold);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
 static public int NextScreen(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         self.NextScreen();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#4
0
 static public int get_CurrentPage(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         pushValue(l, self.CurrentPage);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#5
0
 static public int OnBeginDrag(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         UnityEngine.EventSystems.PointerEventData      a1;
         checkType(l, 2, out a1);
         self.OnBeginDrag(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#6
0
 static public int AddChild(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         UnityEngine.GameObject a1;
         checkType(l, 2, out a1);
         self.AddChild(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#7
0
 static public int set_PageStep(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         System.Single v;
         checkType(l, 2, out v);
         self.PageStep = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#8
0
 static public int GoToScreen(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         self.GoToScreen(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#9
0
 static public int set_StartingScreen(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self.StartingScreen = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#10
0
 static public int set_UseFastSwipe(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         System.Boolean v;
         checkType(l, 2, out v);
         self.UseFastSwipe = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#11
0
 static public int set_PrevButton(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         UnityEngine.GameObject v;
         checkType(l, 2, out v);
         self.PrevButton = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#12
0
 static public int RemoveChild(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.HorizontalScrollSnap self = (UnityEngine.UI.Extensions.HorizontalScrollSnap)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         UnityEngine.GameObject a2;
         self.RemoveChild(a1, out a2);
         pushValue(l, a2);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }