这是集成lua-ptorobuf到Unlua的Module。基于392ace3
- 把本仓库clone之后放到Unlua的ThirdParty下;
- 在
UnLua.uplugin中的Modules下添加如下内容:
{
"Name": "LuaProtobuf",
"Type": "Runtime",
"LoadingPhase": "Default"
}- 在Unlua的
build.cs中添加LuaProtobuf模块依赖; - 在
Unlua的LuaContext.cpp中的FLuaContext::CreateState函数中调用FLuaProtobuf::RegisterLuaLib即可。
FLuaProtobuf& LuaProtobuf = FModuleManager::LoadModuleChecked<FLuaProtobuf>(TEXT("LuaProtobuf"));
LuaProtobuf.RegisterLuaLib(L);注意:模块注册时已经把protoc.lua和serpent.lua都添加了,不需要再把他们放到Content/Script下。