Beispiel #1
0
        public void PushUnityMMOSceneObjectType(RealStatePtr L, UnityMMO.SceneObjectType val)
        {
            if (UnityMMOSceneObjectType_TypeID == -1)
            {
                bool is_first;
                UnityMMOSceneObjectType_TypeID = getTypeId(L, typeof(UnityMMO.SceneObjectType), out is_first);

                if (UnityMMOSceneObjectType_EnumRef == -1)
                {
                    Utils.LoadCSTable(L, typeof(UnityMMO.SceneObjectType));
                    UnityMMOSceneObjectType_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
                }
            }

            if (LuaAPI.xlua_tryget_cachedud(L, (int)val, UnityMMOSceneObjectType_EnumRef) == 1)
            {
                return;
            }

            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, UnityMMOSceneObjectType_TypeID);

            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for UnityMMO.SceneObjectType ,value=" + val);
            }

            LuaAPI.lua_getref(L, UnityMMOSceneObjectType_EnumRef);
            LuaAPI.lua_pushvalue(L, -2);
            LuaAPI.xlua_rawseti(L, -2, (int)val);
            LuaAPI.lua_pop(L, 1);
        }
Beispiel #2
0
        public void UpdateUnityMMOSceneObjectType(RealStatePtr L, int index, UnityMMO.SceneObjectType val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != UnityMMOSceneObjectType_TypeID)
                {
                    throw new Exception("invalid userdata for UnityMMO.SceneObjectType");
                }

                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0, (int)val))
                {
                    throw new Exception("pack fail for UnityMMO.SceneObjectType ,value=" + val);
                }
            }

            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
Beispiel #3
0
        static int _m_GetSceneObjTypeByUID(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityMMO.SceneMgr gen_to_be_invoked = (UnityMMO.SceneMgr)translator.FastGetCSObj(L, 1);



                {
                    long _uid = LuaAPI.lua_toint64(L, 2);

                    UnityMMO.SceneObjectType gen_ret = gen_to_be_invoked.GetSceneObjTypeByUID(_uid);
                    translator.PushUnityMMOSceneObjectType(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #4
0
        public Unity.Entities.Entity __Gen_Delegate_Imp47(object p0, long p1, UnityMMO.SceneObjectType 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);
            LuaAPI.lua_pushint64(L, p1);
            translator.PushUnityMMOSceneObjectType(L, p2);

            PCall(L, 3, 1, errFunc);


            Unity.Entities.Entity __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
        }
Beispiel #5
0
        public void Get(RealStatePtr L, int index, out UnityMMO.SceneObjectType val)
        {
            LuaTypes type = LuaAPI.lua_type(L, index);

            if (type == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != UnityMMOSceneObjectType_TypeID)
                {
                    throw new Exception("invalid userdata for UnityMMO.SceneObjectType");
                }

                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                int    e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for UnityMMO.SceneObjectType");
                }
                val = (UnityMMO.SceneObjectType)e;
            }
            else
            {
                val = (UnityMMO.SceneObjectType)objectCasters.GetCaster(typeof(UnityMMO.SceneObjectType))(L, index, null);
            }
        }