Esempio n. 1
0
    static int set_onSP2End(IntPtr L)
    {
        object o = null;

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

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

            obj.onSP2End = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onSP2End on a nil value" : e.Message));
        }
    }
Esempio n. 2
0
    static int get_onSP2End(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Character         obj = (Character)o;
            Character.OnEvent ret = obj.onSP2End;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onSP2End on a nil value" : e.Message));
        }
    }
Esempio n. 3
0
    public static Delegate Character_OnEvent(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            Character.OnEvent fn = delegate(Character param0) { };
            return(fn);
        }

        if (!flag)
        {
            Character_OnEvent_Event target = new Character_OnEvent_Event(func);
            Character.OnEvent       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            Character_OnEvent_Event target = new Character_OnEvent_Event(func, self);
            Character.OnEvent       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }