Пример #1
0
    static int AddFrame(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 4);
        Scheduler obj       = (Scheduler)LuaScriptMgr.GetNetObjectSelf(L, 1, "Scheduler");
        uint      arg0      = (uint)LuaScriptMgr.GetNumber(L, 2);
        bool      arg1      = LuaScriptMgr.GetBoolean(L, 3);
        Action    arg2      = null;
        LuaTypes  funcType4 = LuaDLL.lua_type(L, 4);

        if (funcType4 != LuaTypes.LUA_TFUNCTION)
        {
            arg2 = (Action)LuaScriptMgr.GetNetObject(L, 4, typeof(Action));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 4);
            arg2 = () =>
            {
                func.Call();
            };
        }

        obj.AddFrame(arg0, arg1, arg2);
        return(0);
    }