Ejemplo n.º 1
0
        /// <summary>
        /// Activates the debug hook
        /// </summary>
        /// <param name = "mask">Mask</param>
        /// <param name = "count">Count</param>
        /// <returns>see lua docs. -1 if hook is already set</returns>
        /// <author>Reinhard Ostermeier</author>
        public int SetDebugHook(EventMasks mask, int count)
        {
            if(hookCallback.IsNull())
            {
                hookCallback = new LuaCore.lua_Hook(DebugHookCallback);
                return LuaCore.lua_sethook(luaState, hookCallback, (int)mask, count);
            }

            return -1;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes the debug hook
 /// </summary>
 /// <returns>see lua docs</returns>
 /// <author>Reinhard Ostermeier</author>
 public int RemoveDebugHook()
 {
     hookCallback = null;
     return LuaCore.lua_sethook(luaState, null, 0, 0);
 }