Example #1
0
    static int set_onFinish(IntPtr L)
    {
        object o = null;

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

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

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

        try
        {
            o = ToLua.ToObject(L, 1);
            TypeWriter            obj = (TypeWriter)o;
            TypeWriter.LuaExecute ret = obj.onFinish;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onFinish on a nil value" : e.Message));
        }
    }