Example #1
0
    static int Create(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 4);
            EffectRenderObj obj  = (EffectRenderObj)ToLua.CheckObject(L, 1, typeof(EffectRenderObj));
            string          arg0 = ToLua.CheckString(L, 2);
            string          arg1 = ToLua.CheckString(L, 3);
            EffectRenderObj.LoadComCallBack arg2 = null;
            LuaTypes funcType4 = LuaDLL.lua_type(L, 4);

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

            bool o = obj.Create(ref arg0, ref arg1, arg2);
            LuaDLL.lua_pushboolean(L, o);
            LuaDLL.lua_pushstring(L, arg0);
            LuaDLL.lua_pushstring(L, arg1);
            return(3);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
    public static Delegate EffectRenderObj_LoadComCallBack(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            EffectRenderObj.LoadComCallBack fn = delegate(EffectRenderObj param0) { };
            return(fn);
        }

        if (!flag)
        {
            EffectRenderObj.LoadComCallBack d = (new EffectRenderObj_LoadComCallBack_Event(func)).Call;
            return(d);
        }
        else
        {
            EffectRenderObj.LoadComCallBack d = (new EffectRenderObj_LoadComCallBack_Event(func, self)).CallWithSelf;
            return(d);
        }
    }