static int Add(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4)
            {
                FairyGUI.Timers        obj  = (FairyGUI.Timers)ToLua.CheckObject <FairyGUI.Timers>(L, 1);
                float                  arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
                int                    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                FairyGUI.TimerCallback arg2 = (FairyGUI.TimerCallback)ToLua.CheckDelegate <FairyGUI.TimerCallback>(L, 4);
                obj.Add(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 5)
            {
                FairyGUI.Timers        obj  = (FairyGUI.Timers)ToLua.CheckObject <FairyGUI.Timers>(L, 1);
                float                  arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
                int                    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                FairyGUI.TimerCallback arg2 = (FairyGUI.TimerCallback)ToLua.CheckDelegate <FairyGUI.TimerCallback>(L, 4);
                object                 arg3 = ToLua.ToVarObject(L, 5);
                obj.Add(arg0, arg1, arg2, arg3);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Timers.Add"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Пример #2
0
    static int Add(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Timers), typeof(float), typeof(int), typeof(FairyGUI.TimerCallback)))
            {
                FairyGUI.Timers        obj       = (FairyGUI.Timers)ToLua.ToObject(L, 1);
                float                  arg0      = (float)LuaDLL.lua_tonumber(L, 2);
                int                    arg1      = (int)LuaDLL.lua_tonumber(L, 3);
                FairyGUI.TimerCallback arg2      = null;
                LuaTypes               funcType4 = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (FairyGUI.TimerCallback)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(FairyGUI.TimerCallback), func) as FairyGUI.TimerCallback;
                }

                obj.Add(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Timers), typeof(float), typeof(int), typeof(FairyGUI.TimerCallback), typeof(object)))
            {
                FairyGUI.Timers        obj       = (FairyGUI.Timers)ToLua.ToObject(L, 1);
                float                  arg0      = (float)LuaDLL.lua_tonumber(L, 2);
                int                    arg1      = (int)LuaDLL.lua_tonumber(L, 3);
                FairyGUI.TimerCallback arg2      = null;
                LuaTypes               funcType4 = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (FairyGUI.TimerCallback)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(FairyGUI.TimerCallback), func) as FairyGUI.TimerCallback;
                }

                object arg3 = ToLua.ToVarObject(L, 5);
                obj.Add(arg0, arg1, arg2, arg3);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Timers.Add"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int Add(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 4)
         {
             FairyGUI.Timers self = (FairyGUI.Timers)checkSelf(l);
             System.Single   a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             FairyGUI.TimerCallback a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             self.Add(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             FairyGUI.Timers self = (FairyGUI.Timers)checkSelf(l);
             System.Single   a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             FairyGUI.TimerCallback a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             System.Object a4;
             checkType(l, 5, out a4);
             self.Add(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }