Esempio n. 1
0
 static public int Dispose(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         self.Dispose();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 2
0
 static public int get_position(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.position);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 3
0
 static public int Enable(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         System.Boolean        a1;
         checkType(l, 2, out a1);
         self.Enable(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 4
0
 static public int set_snapping(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         System.Boolean        v;
         checkType(l, 2, out v);
         self.snapping = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int Dispose(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)ToLua.CheckObject <FairyGUI.SwipeGesture>(L, 1);
         obj.Dispose();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 6
0
 static public int set_position(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         UnityEngine.Vector2   v;
         checkType(l, 2, out v);
         self.position = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 7
0
 static public int set_actionDistance(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture self = (FairyGUI.SwipeGesture)checkSelf(l);
         System.Int32          v;
         checkType(l, 2, out v);
         self.actionDistance = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 8
0
 static public int constructor(IntPtr l)
 {
     try {
         FairyGUI.SwipeGesture o;
         FairyGUI.GObject      a1;
         checkType(l, 2, out a1);
         o = new FairyGUI.SwipeGesture(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int Enable(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)ToLua.CheckObject <FairyGUI.SwipeGesture>(L, 1);
         bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.Enable(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_snapping(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            bool ret = obj.snapping;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index snapping on a nil value"));
        }
    }
    static int get_velocity(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            UnityEngine.Vector2   ret = obj.velocity;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index velocity on a nil value"));
        }
    }
    static int set_snapping(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.snapping = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index snapping on a nil value"));
        }
    }
    static int set_actionDistance(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.actionDistance = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index actionDistance on a nil value"));
        }
    }
    static int set_delta(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj  = (FairyGUI.SwipeGesture)o;
            UnityEngine.Vector2   arg0 = ToLua.ToVector2(L, 2);
            obj.delta = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index delta on a nil value"));
        }
    }
    static int get_onAction(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture  obj = (FairyGUI.SwipeGesture)o;
            FairyGUI.EventListener ret = obj.onAction;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onAction on a nil value"));
        }
    }
    static int get_host(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            FairyGUI.GObject      ret = obj.host;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index host on a nil value"));
        }
    }
    static int get_actionDistance(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.SwipeGesture obj = (FairyGUI.SwipeGesture)o;
            int ret = obj.actionDistance;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index actionDistance on a nil value"));
        }
    }
Esempio n. 18
0
    void Start()
    {
        _mainView = this.GetComponent <UIPanel>().ui;
        GObject holder = _mainView.GetChild("holder");

        _ball = GameObject.Find("Globe").transform;

        FairyGUI.SwipeGesture gesture1 = new FairyGUI.SwipeGesture(holder);
        gesture1.onMove.Add(OnSwipeMove);
        gesture1.onEnd.Add(OnSwipeEnd);

        FairyGUI.LongPressGesture gesture2 = new FairyGUI.LongPressGesture(holder);
        gesture2.once = false;
        gesture2.onAction.Add(OnHold);

        FairyGUI.PinchGesture gesture3 = new FairyGUI.PinchGesture(holder);
        gesture3.onAction.Add(OnPinch);

        FairyGUI.RotationGesture gesture4 = new FairyGUI.RotationGesture(holder);
        gesture4.onAction.Add(OnRotate);
    }
Esempio n. 19
0
    void OnSwipeEnd(EventContext context)
    {
        FairyGUI.SwipeGesture gesture = (FairyGUI.SwipeGesture)context.sender;
        Vector3 v = new Vector3();

        if (Mathf.Abs(gesture.velocity.x) > Mathf.Abs(gesture.velocity.y))
        {
            v.y = -Mathf.Round(Mathf.Sign(gesture.velocity.x) * Mathf.Sqrt(Mathf.Abs(gesture.velocity.x)));
            if (Mathf.Abs(v.y) < 2)
            {
                return;
            }
        }
        else
        {
            v.x = -Mathf.Round(Mathf.Sign(gesture.velocity.y) * Mathf.Sqrt(Mathf.Abs(gesture.velocity.y)));
            if (Mathf.Abs(v.x) < 2)
            {
                return;
            }
        }
        _ball.DORotate(v, 0.3f, RotateMode.WorldAxisAdd);
    }
Esempio n. 20
0
    void OnSwipeMove(EventContext context)
    {
        FairyGUI.SwipeGesture gesture = (FairyGUI.SwipeGesture)context.sender;
        Vector3 v = new Vector3();

        if (Mathf.Abs(gesture.delta.x) > Mathf.Abs(gesture.delta.y))
        {
            v.y = -Mathf.Round(gesture.delta.x);
            if (Mathf.Abs(v.y) < 2) //消除手抖的影响
            {
                return;
            }
        }
        else
        {
            v.x = -Mathf.Round(gesture.delta.y);
            if (Mathf.Abs(v.x) < 2)
            {
                return;
            }
        }
        _ball.Rotate(v, Space.World);
    }
    static int _CreateFairyGUI_SwipeGesture(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                FairyGUI.GObject      arg0 = (FairyGUI.GObject)ToLua.CheckObject <FairyGUI.GObject>(L, 1);
                FairyGUI.SwipeGesture obj  = new FairyGUI.SwipeGesture(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.SwipeGesture.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 22
0
    void Start()
    {
        _mainView = this.GetComponent<UIPanel>().ui;
        GObject holder = _mainView.GetChild("holder");

        _ball = GameObject.Find("Globe").transform;

        FairyGUI.SwipeGesture gesture1 = new FairyGUI.SwipeGesture(holder);
        gesture1.onMove.Add(OnSwipeMove);
        gesture1.onEnd.Add(OnSwipeEnd);

        FairyGUI.LongPressGesture gesture2 = new FairyGUI.LongPressGesture(holder);
        gesture2.once = false;
        gesture2.onAction.Add(OnHold);

        FairyGUI.PinchGesture gesture3 = new FairyGUI.PinchGesture(holder);
        gesture3.onAction.Add(OnPinch);

        FairyGUI.RotationGesture gesture4 = new FairyGUI.RotationGesture(holder);
        gesture4.onAction.Add(OnRotate);
    }