static internal int checkDelegate(IntPtr l, int p, out UIScrollView.OnDragNotification ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, p))
            {
                ua = null;
                return(op);
            }
            else if (LuaDLL.lua_isuserdata(l, p) == 1)
            {
                ua = (UIScrollView.OnDragNotification)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            LuaDLL.lua_pop(l, 1);
            if (ld.d != null)
            {
                ua = (UIScrollView.OnDragNotification)ld.d;
                return(op);
            }

            l  = LuaState.get(l).L;
            ua = () =>
            {
                int error = pushTry(l);

                ld.pcall(0, error);
                LuaDLL.lua_settop(l, error - 1);
            };
            ld.d = ua;
            return(op);
        }
コード例 #2
0
    static int set_onDragEndFromBottom(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIScrollView obj = (UIScrollView)o;
            UIScrollView.OnDragNotification arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (UIScrollView.OnDragNotification)ToLua.CheckObject(L, 2, typeof(UIScrollView.OnDragNotification));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(UIScrollView.OnDragNotification), func) as UIScrollView.OnDragNotification;
            }

            obj.onDragEndFromBottom = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onDragEndFromBottom on a nil value" : e.Message));
        }
    }
コード例 #3
0
 public static Delegate UIScrollView_OnDragNotification(LuaFunction func)
 {
     UIScrollView.OnDragNotification d = () =>
     {
         func.Call();
     };
     return(d);
 }
コード例 #4
0
    private void Start()
    {
        UIScrollView component = scrollViewPanel.GetComponent <UIScrollView>();

        // ISSUE: method pointer
        UIScrollView.OnDragNotification dragNotification = (UIScrollView.OnDragNotification)Delegate.Combine(component.onStoppedMoving, (UIScrollView.OnDragNotification)SnappingScroll);
        component.onStoppedMoving = dragNotification;
    }
コード例 #5
0
 public static UIScrollView.OnDragNotification ScrollViewVoidDelegate(LuaFunction func)
 {
     UIScrollView.OnDragNotification action = () =>
     {
         func.Call();
     };
     return(action);
 }
コード例 #6
0
    public static Delegate UIScrollView_OnDragNotification(LuaFunction func)
    {
        if (func == null)
        {
            UIScrollView.OnDragNotification fn = delegate { };
            return(fn);
        }

        UIScrollView.OnDragNotification d = (new UIScrollView_OnDragNotification_Event(func)).Call;
        return(d);
    }
コード例 #7
0
ファイル: UIWrapContentEx.cs プロジェクト: giterwen/U3D
    public void SetScrollViewDragFinish(UIScrollView.OnDragNotification onDragFinished_)
    {
        onScrollFinish = onDragFinished_;
        if (mScroll == null)
        {
            return;
        }

        if (onScrollFinish != null)
        {
            mScroll.onDragFinished = onScrollFinish;
        }
    }
コード例 #8
0
 static int ScrollViewVoidDelegate(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaFunction arg0 = ToLua.CheckLuaFunction(L, 1);
         UIScrollView.OnDragNotification o = LuaHelper.ScrollViewVoidDelegate(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #9
0
ファイル: UIScrollViewWrap.cs プロジェクト: zhygmsz/newclient
    static int get_onStoppedMoving(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIScrollView obj = (UIScrollView)o;
            UIScrollView.OnDragNotification ret = obj.onStoppedMoving;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onStoppedMoving on a nil value"));
        }
    }
コード例 #10
0
ファイル: UIScrollViewWrap.cs プロジェクト: zhygmsz/newclient
    static int set_onStoppedMoving(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIScrollView obj = (UIScrollView)o;
            UIScrollView.OnDragNotification arg0 = (UIScrollView.OnDragNotification)ToLua.CheckDelegate <UIScrollView.OnDragNotification>(L, 2);
            obj.onStoppedMoving = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onStoppedMoving on a nil value"));
        }
    }
コード例 #11
0
    static int get_onDragEndFromBottom(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIScrollView obj = (UIScrollView)o;
            UIScrollView.OnDragNotification ret = obj.onDragEndFromBottom;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onDragEndFromBottom on a nil value" : e.Message));
        }
    }
コード例 #12
0
    private static int get_onStoppedMoving(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIScrollView uIScrollView = (UIScrollView)obj;
            UIScrollView.OnDragNotification onStoppedMoving = uIScrollView.onStoppedMoving;
            ToLua.Push(L, onStoppedMoving);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onStoppedMoving on a nil value");
        }
        return(result);
    }
コード例 #13
0
    public UIScrollView.OnDragNotification UIScrollView_OnDragNotification(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            UIScrollView.OnDragNotification fn = delegate() { };
            return(fn);
        }

        if (!flag)
        {
            UIScrollView_OnDragNotification_Event target = new UIScrollView_OnDragNotification_Event(func);
            UIScrollView.OnDragNotification       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            UIScrollView_OnDragNotification_Event target = new UIScrollView_OnDragNotification_Event(func, self);
            UIScrollView.OnDragNotification       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
コード例 #14
0
    void Start()
    {
        DataManager = GameDataManager.ManangerInstance;

        var scrollView = ScrollViewTransform.GetComponent <UIScrollView>();

        UIScrollView.OnDragNotification x = new UIScrollView.OnDragNotification(PlaySound);
        scrollView.onMomentumMove = x;

        UIScrollView.OnDragNotification y = new UIScrollView.OnDragNotification(SeasonLockManager);
        scrollView.onStoppedMoving = y;

        UIScrollView.OnDragNotification z = new UIScrollView.OnDragNotification(FirstSlideSet);
        scrollView.onStoppedMoving = z;

        if (DataManager.IsFirstGuide)
        {
            PGuide1.GetComponent <TweenAlpha>().PlayForward();
            DataManager.IsFirstGuide = false;
            DataManager.Save();
        }
        else
        {
            PGuide1.SetActive(false);
        }


        FirstScrollPos   = ScrollViewTransform.localPosition.x;
        GridCellPaddingX = SliderGrid.cellWidth;
        for (int i = 0; i < Pages.Length; i++)
        {
            Pages[i].PagePos = FirstScrollPos - i * GridCellPaddingX;
        }


        Invoke("GotoCurrentLevelPage", .3f);
    }
コード例 #15
0
 void Push_UIScrollView_OnDragNotification(IntPtr L, UIScrollView.OnDragNotification o)
 {
     ToLua.Push(L, o);
 }