示例#1
0
文件: Lua.cs 项目: WolfpawGroup/RTC3
        /// <summary>
        ///
        /// </summary>
        /// <param name="chunk"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public LuaFunction LoadString(string chunk, string name)
        {
            int oldTop = LuaDLL.lua_gettop(luaState);

            executing = true;
            try
            {
                if (LuaDLL.luaL_loadbuffer(luaState, chunk, name) != 0)
                {
                    ThrowExceptionFromError(oldTop);
                }
            }
            finally { executing = false; }

            LuaFunction result = translator.getFunction(luaState, -1);

            translator.popValues(luaState, oldTop);

            return(result);
        }
示例#2
0
 public object extractGenerated(IntPtr luaState, int stackPos)
 {
     return(CodeGeneration.Instance.GetDelegate(delegateType, translator.getFunction(luaState, stackPos)));
 }
示例#3
0
 private object getAsFunction(LuaCore.lua_State luaState, int stackPos)
 {
     return(translator.getFunction(luaState, stackPos));
 }
示例#4
0
 private object getAsFunction(IntPtr luaState, int stackPos)
 {
     return(translator.getFunction(luaState, stackPos));
 }