第一章.编译lua-protobuf支持库(Windows插件-Win10编译)
第二章.Unity & lua-protobuf 环境配置
第三章.二进制proto读取功能,与,lua-protobuf注意事项简介说明
第四章.编译lua-protobuf支持库(Android插件-Win10编译)
第五章.编译lua-protobuf支持库(Android插件-Mac10.13.6编译)
第六章.编译lua-protobuf支持库(IOS插件-Mac10.13.6编译)
一,Unity配置lua-protobuf支持设置
1,打开自己新建的Unity工程D:\lua_proto\Assets\XLua\Src\LuaDLL.cs文件
大概41行
public partial class Lua
{
#if (UNITY_IPHONE || UNITY_TVOS || UNITY_WEBGL || UNITY_SWITCH) && !UNITY_EDITOR
const string LUADLL = "__Internal";
#else
const string LUADLL = "xlua";
#endif
以上代码下面复子粘贴,以下代码
//LUA支持PROTOBUF
[DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
public static extern int luaopen_protobuf_c(System.IntPtr L);
[MonoPInvokeCallback(typeof(LuaDLL.lua_CSFunction))]
public static int LoadProtobufC(System.IntPtr L)
{
return luaopen_protobuf_c(L);
}
[DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
public static extern int luaopen_pb(System.IntPtr L);
[MonoPInvokeCallback(typeof(LuaDLL.lua_CSFunction))

本文详细介绍了如何在Unity环境中配置Lua-Protobuf,实现二进制proto文件的读取功能。通过修改Unity工程中的LuaDLL.cs和LuaEnv.cs文件,以及编写测试用的C#、Lua和Proto代码,演示了完整的配置流程和测试步骤。

1193

被折叠的 条评论
为什么被折叠?



