public void PushUnityMMOSceneInfoKey(RealStatePtr L, UnityMMO.SceneInfoKey val) { if (UnityMMOSceneInfoKey_TypeID == -1) { bool is_first; UnityMMOSceneInfoKey_TypeID = getTypeId(L, typeof(UnityMMO.SceneInfoKey), out is_first); if (UnityMMOSceneInfoKey_EnumRef == -1) { Utils.LoadCSTable(L, typeof(UnityMMO.SceneInfoKey)); UnityMMOSceneInfoKey_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX); } } if (LuaAPI.xlua_tryget_cachedud(L, (int)val, UnityMMOSceneInfoKey_EnumRef) == 1) { return; } IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, UnityMMOSceneInfoKey_TypeID); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail fail for UnityMMO.SceneInfoKey ,value=" + val); } LuaAPI.lua_getref(L, UnityMMOSceneInfoKey_EnumRef); LuaAPI.lua_pushvalue(L, -2); LuaAPI.xlua_rawseti(L, -2, (int)val); LuaAPI.lua_pop(L, 1); }
public void UpdateUnityMMOSceneInfoKey(RealStatePtr L, int index, UnityMMO.SceneInfoKey val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityMMOSceneInfoKey_TypeID) { throw new Exception("invalid userdata for UnityMMO.SceneInfoKey"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail for UnityMMO.SceneInfoKey ,value=" + val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } }
public void Get(RealStatePtr L, int index, out UnityMMO.SceneInfoKey val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityMMOSceneInfoKey_TypeID) { throw new Exception("invalid userdata for UnityMMO.SceneInfoKey"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); int e; if (!CopyByValue.UnPack(buff, 0, out e)) { throw new Exception("unpack fail for UnityMMO.SceneInfoKey"); } val = (UnityMMO.SceneInfoKey)e; } else { val = (UnityMMO.SceneInfoKey)objectCasters.GetCaster(typeof(UnityMMO.SceneInfoKey))(L, index, null); } }