public bool __Gen_Delegate_Imp1(UnityEngine.Ray p0, out UnityEngine.RaycastHit p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushUnityEngineRay(L, p0);

            PCall(L, 1, 2, errFunc);

            translator.Get(L, errFunc + 2, out p1);

            bool __gen_ret = LuaAPI.lua_toboolean(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 2
0
		public UnityEngine.Vector3 __Gen_Delegate_Imp14(object p0, UnityEngine.Vector3 p1, UnityEngine.Vector3 p2)
		{
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
                ObjectTranslator translator = luaEnv.translator;
                translator.PushAny(L, p0);
                translator.PushUnityEngineVector3(L, p1);
                translator.PushUnityEngineVector3(L, p2);
                
                PCall(L, 3, 1, errFunc);
                
                
                UnityEngine.Vector3 __gen_ret;translator.Get(L, errFunc + 1, out __gen_ret);
                LuaAPI.lua_settop(L, errFunc - 1);
                return  __gen_ret;
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
		}
Esempio n. 3
0
		public UnityEngine.GameObject __Gen_Delegate_Imp19(IFramework.Hotfix.Lua.StructTest p0, int p1, object p2)
		{
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
                ObjectTranslator translator = luaEnv.translator;
                translator.Push(L, p0);
                LuaAPI.xlua_pushinteger(L, p1);
                translator.PushAny(L, p2);
                
                PCall(L, 3, 1, errFunc);
                
                
                UnityEngine.GameObject __gen_ret = (UnityEngine.GameObject)translator.GetObject(L, errFunc + 1, typeof(UnityEngine.GameObject));
                LuaAPI.lua_settop(L, errFunc - 1);
                return  __gen_ret;
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
		}
Esempio n. 4
0
        public Unity.Rendering.MeshInstanceRenderer __Gen_Delegate_Imp10(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushAny(L, p1);

            PCall(L, 2, 1, errFunc);


            Unity.Rendering.MeshInstanceRenderer __gen_ret; translator.Get(L, errFunc + 1, out __gen_ret);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 5
0
		public int __Gen_Delegate_Imp9(int p0, string p1, out Tutorial.CSCallLua.DClass p2)
		{
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
                ObjectTranslator translator = luaEnv.translator;
                LuaAPI.xlua_pushinteger(L, p0);
                LuaAPI.lua_pushstring(L, p1);
                
                PCall(L, 2, 2, errFunc);
                
                p2 = (Tutorial.CSCallLua.DClass)translator.GetObject(L, errFunc + 2, typeof(Tutorial.CSCallLua.DClass));
                
                int __gen_ret = LuaAPI.xlua_tointeger(L, errFunc + 1);
                LuaAPI.lua_settop(L, errFunc - 1);
                return  __gen_ret;
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
		}
Esempio n. 6
0
        public XLuaTest.MyEnum __Gen_Delegate_Imp22(object p0, XLuaTest.MyEnum p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushXLuaTestMyEnum(L, p1);

            PCall(L, 2, 1, errFunc);


            XLuaTest.MyEnum __gen_ret; translator.Get(L, errFunc + 1, out __gen_ret);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 7
0
        public bool __Gen_Delegate_Imp17(System.IntPtr p0, int p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.lua_pushlightuserdata(L, p0);
            LuaAPI.xlua_pushinteger(L, p1);

            PCall(L, 2, 1, errFunc);


            bool __gen_ret = LuaAPI.lua_toboolean(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 8
0
        public System.Collections.Generic.List <byte> __Gen_Delegate_Imp3(int p0, string p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            LuaAPI.xlua_pushinteger(L, p0);
            LuaAPI.lua_pushstring(L, p1);

            PCall(L, 2, 1, errFunc);


            System.Collections.Generic.List <byte> __gen_ret = (System.Collections.Generic.List <byte>)translator.GetObject(L, errFunc + 1, typeof(System.Collections.Generic.List <byte>));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 9
0
        public XLua.LuaBase __Gen_Delegate_Imp11(int p0, XLua.LuaEnv p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            LuaAPI.xlua_pushinteger(L, p0);
            translator.Push(L, p1);

            PCall(L, 2, 1, errFunc);


            XLua.LuaBase __gen_ret = (XLua.LuaBase)translator.GetObject(L, errFunc + 1, typeof(XLua.LuaBase));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 10
0
        public bool __Gen_Delegate_Imp0(BubbleScript p0, float p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.Push(L, p0);
            LuaAPI.lua_pushnumber(L, p1);

            PCall(L, 2, 1, errFunc);


            bool __gen_ret = LuaAPI.lua_toboolean(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 11
0
        public string __Gen_Delegate_Imp40(int p0, int p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.xlua_pushinteger(L, p0);
            LuaAPI.xlua_pushinteger(L, p1);

            PCall(L, 2, 1, errFunc);


            string __gen_ret = LuaAPI.lua_tostring(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 12
0
        public void __Gen_Delegate_Imp36(object p0, XLuaFramework.DisType p1, object p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushXLuaFrameworkDisType(L, p1);
            translator.PushAny(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 13
0
        public void __Gen_Delegate_Imp13(SkillBridge.Message.Result p0, string p1, SkillBridge.Message.NCharacterInfo p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushSkillBridgeMessageResult(L, p0);
            LuaAPI.lua_pushstring(L, p1);
            translator.Push(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 14
0
        public System.Collections.IEnumerator __Gen_Delegate_Imp35(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushAny(L, p1);

            PCall(L, 2, 1, errFunc);


            System.Collections.IEnumerator __gen_ret = (System.Collections.IEnumerator)translator.GetObject(L, errFunc + 1, typeof(System.Collections.IEnumerator));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 15
0
        public void __Gen_Delegate_Imp18(string p0, string p1, UnityEngine.LogType p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            LuaAPI.lua_pushstring(L, p0);
            LuaAPI.lua_pushstring(L, p1);
            translator.Push(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
        public void __Gen_Delegate_Imp16(float p0, float p1, float p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.lua_pushnumber(L, p0);
            LuaAPI.lua_pushnumber(L, p1);
            LuaAPI.lua_pushnumber(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 17
0
        public UnityMMO.SceneObjectType __Gen_Delegate_Imp53(object p0, long p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            LuaAPI.lua_pushint64(L, p1);

            PCall(L, 2, 1, errFunc);


            UnityMMO.SceneObjectType __gen_ret; translator.Get(L, errFunc + 1, out __gen_ret);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 18
0
        public int __Gen_Delegate_Imp45(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushAny(L, p1);

            PCall(L, 2, 1, errFunc);


            int __gen_ret = LuaAPI.xlua_tointeger(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 19
0
        public double __Gen_Delegate_Imp4(double p0, double p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.lua_pushnumber(L, p0);
            LuaAPI.lua_pushnumber(L, p1);

            PCall(L, 2, 1, errFunc);


            double __gen_ret = LuaAPI.lua_tonumber(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 20
0
        //no boxing version set
        public void Set <TKey, TValue>(TKey key, TValue value)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            var L          = luaEnv.L;
            int oldTop     = LuaAPI.lua_gettop(L);
            var translator = luaEnv.translator;

            LuaAPI.lua_getref(L, luaReference);
            translator.PushByType(L, key);
            translator.PushByType(L, value);

            if (0 != LuaAPI.xlua_psettable(L, -3))
            {
                luaEnv.ThrowExceptionFromError(oldTop);
            }
            LuaAPI.lua_settop(L, oldTop);
#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
        public void __Gen_Delegate_Imp3(XLua.LuaTable p0, int p1, object p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.Push(L, p0);
            LuaAPI.xlua_pushinteger(L, p1);
            translator.PushAny(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 22
0
        public byte[] __Gen_Delegate_Imp27(ref string p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.lua_pushstring(L, p0);

            PCall(L, 1, 2, errFunc);

            p0 = LuaAPI.lua_tostring(L, errFunc + 2);

            byte[] __gen_ret = LuaAPI.lua_tobytes(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 23
0
        public void Action <T1, T2>(T1 a1, T2 a2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            var L          = luaEnv.L;
            var translator = luaEnv.translator;
            int oldTop     = LuaAPI.lua_gettop(L);
            int errFunc    = LuaAPI.load_error_func(L, luaEnv.errorFuncRef);
            LuaAPI.lua_getref(L, luaReference);
            translator.PushByType(L, a1);
            translator.PushByType(L, a2);
            int error = LuaAPI.lua_pcall(L, 2, 0, errFunc);
            if (error != 0)
            {
                luaEnv.ThrowExceptionFromError(oldTop);
            }
            LuaAPI.lua_settop(L, oldTop);
#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 24
0
        public UnityEngine.Component __Gen_Delegate_Imp21(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.PushAny(L, p1);

            PCall(L, 2, 1, errFunc);


            UnityEngine.Component __gen_ret = (UnityEngine.Component)translator.GetObject(L, errFunc + 1, typeof(UnityEngine.Component));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 25
0
        public void __Gen_Delegate_Imp12(object p0, Game.LoggerHelper.LOG_TYPE p1, object p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.Push(L, p1);
            translator.PushAny(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 26
0
        public void __Gen_Delegate_Imp6(ushort p0, ushort p1, byte[] p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);

            LuaAPI.xlua_pushinteger(L, p0);
            LuaAPI.xlua_pushinteger(L, p1);
            LuaAPI.lua_pushstring(L, p2);

            PCall(L, 3, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 27
0
        public InvokeLua.ICalc __Gen_Delegate_Imp5(int p0, string[] p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int err_func   = LuaAPI.load_error_func(L, errorFuncRef);
            ObjectTranslator translator = luaEnv.translator;

            LuaAPI.lua_getref(L, luaReference);

            LuaAPI.xlua_pushinteger(L, p0);
            if (p1 != null)
            {
                for (int __gen_i = 0; __gen_i < p1.Length; ++__gen_i)
                {
                    LuaAPI.lua_pushstring(L, p1[__gen_i]);
                }
            }
            ;

            int __gen_error = LuaAPI.lua_pcall(L, 1 + (p1 == null ? 0 : p1.Length), 1, err_func);
            if (__gen_error != 0)
            {
                luaEnv.ThrowExceptionFromError(err_func - 1);
            }


            InvokeLua.ICalc __gen_ret = (InvokeLua.ICalc)translator.GetObject(L, err_func + 1, typeof(InvokeLua.ICalc));
            LuaAPI.lua_settop(L, err_func - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 28
0
        public TResult Func <T1, T2, TResult>(T1 a1, T2 a2)
        {
#if THREAD_SAFT || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            var L          = luaEnv.L;
            var translator = luaEnv.translator;
            int oldTop     = LuaAPI.lua_gettop(L);
            int errFunc    = LuaAPI.load_error_func(L, luaEnv.errorFuncRef);
            LuaAPI.lua_getref(L, luaReference);
            translator.PushByType(L, a1);
            translator.PushByType(L, a2);
            int error = LuaAPI.lua_pcall(L, 2, 1, errFunc);
            if (error != 0)
            {
                luaEnv.ThrowExceptionFromError(oldTop);
            }
            TResult ret;
            try
            {
                translator.Get(L, -1, out ret);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                LuaAPI.lua_settop(L, oldTop);
            }
            return(ret);

#if THREAD_SAFT || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 29
0
        public void ForEach <TKey, TValue>(Func <TKey, TValue, bool> action)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            var L          = luaEnv.L;
            var translator = luaEnv.translator;
            int oldTop     = LuaAPI.lua_gettop(L);
            try
            {
                LuaAPI.lua_getref(L, luaReference);
                LuaAPI.lua_pushnil(L);
                while (LuaAPI.lua_next(L, -2) != 0)
                {
                    if (translator.Assignable <TKey>(L, -2))
                    {
                        TKey key;
                        TValue val;
                        translator.Get(L, -2, out key);
                        translator.Get(L, -1, out val);
                        if (action(key, val))
                        {
                            break;
                        }
                    }
                    LuaAPI.lua_pop(L, 1);
                }
            }
            finally
            {
                LuaAPI.lua_settop(L, oldTop);
            }
#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 30
0
        // no boxing version get
        public void RawGet <TKey, TValue>(TKey key, out TValue value)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            var L          = luaEnv.L;
            var translator = luaEnv.translator;
            int oldTop     = LuaAPI.lua_gettop(L);
            LuaAPI.lua_getref(L, luaReference);
            translator.PushByType(L, key);

            LuaAPI.lua_rawget(L, -2);

            LuaTypes lua_type  = LuaAPI.lua_type(L, -1);
            Type type_of_value = typeof(TValue);
            if (lua_type == LuaTypes.LUA_TNIL && type_of_value.IsValueType())
            {
                throw new InvalidCastException("can not assign nil to " + type_of_value.GetFriendlyName());
            }

            try
            {
                translator.Get(L, -1, out value);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                LuaAPI.lua_settop(L, oldTop);
            }
#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }