示例#1
0
    void OnPinch(EventContext context)
    {
        DOTween.Kill(_ball);

        FairyGUI.PinchGesture gesture = (FairyGUI.PinchGesture)context.sender;
        float newValue = Mathf.Clamp(_ball.localScale.x + gesture.delta, 0.3f, 2);

        _ball.localScale = new Vector3(newValue, newValue, newValue);
    }
 static int Dispose(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.PinchGesture obj = (FairyGUI.PinchGesture)ToLua.CheckObject <FairyGUI.PinchGesture>(L, 1);
         obj.Dispose();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int set_delta(IntPtr l)
 {
     try {
         FairyGUI.PinchGesture self = (FairyGUI.PinchGesture)checkSelf(l);
         System.Single         v;
         checkType(l, 2, out v);
         self.delta = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int Enable(IntPtr l)
 {
     try {
         FairyGUI.PinchGesture self = (FairyGUI.PinchGesture)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));
     }
 }
 static int Enable(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.PinchGesture obj = (FairyGUI.PinchGesture)ToLua.CheckObject <FairyGUI.PinchGesture>(L, 1);
         bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.Enable(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         FairyGUI.PinchGesture o;
         FairyGUI.GObject      a1;
         checkType(l, 2, out a1);
         o = new FairyGUI.PinchGesture(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int get_scale(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.PinchGesture obj = (FairyGUI.PinchGesture)o;
            float ret = obj.scale;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index scale on a nil value"));
        }
    }
    static int set_delta(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.PinchGesture obj = (FairyGUI.PinchGesture)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(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.PinchGesture  obj = (FairyGUI.PinchGesture)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.PinchGesture obj = (FairyGUI.PinchGesture)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"));
        }
    }
示例#11
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);
    }
    static int _CreateFairyGUI_PinchGesture(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                FairyGUI.GObject      arg0 = (FairyGUI.GObject)ToLua.CheckObject <FairyGUI.GObject>(L, 1);
                FairyGUI.PinchGesture obj  = new FairyGUI.PinchGesture(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.PinchGesture.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#13
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);
    }