コード例 #1
0
    static int set_onDragEnd(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.DragListener obj = (UI.DragListener)o;
            System.Action <UnityEngine.EventSystems.PointerEventData> arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (System.Action <UnityEngine.EventSystems.PointerEventData>)ToLua.CheckObject(L, 2, typeof(System.Action <UnityEngine.EventSystems.PointerEventData>));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(System.Action <UnityEngine.EventSystems.PointerEventData>), func) as System.Action <UnityEngine.EventSystems.PointerEventData>;
            }

            obj.onDragEnd = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onDragEnd on a nil value" : e.Message));
        }
    }
コード例 #2
0
        void CheckDragListener()
        {
            DragListener l = this.GetComponent <DragListener>();

            if (l != null)
            {
                return;
            }
            l             = this.gameObject.AddComponentIfNoExist <DragListener>();
            l.onDragBegin = OnBeginDrag;
            l.onDrag      = OnDrag;
            l.onDragEnd   = OnEndDrag;
        }
コード例 #3
0
 static int OnEndDrag(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.DragListener obj = (UI.DragListener)ToLua.CheckObject(L, 1, typeof(UI.DragListener));
         UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData));
         obj.OnEndDrag(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
    static int get_onDragEnd(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.DragListener obj = (UI.DragListener)o;
            System.Action <UnityEngine.EventSystems.PointerEventData> ret = obj.onDragEnd;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onDragEnd on a nil value" : e.Message));
        }
    }