在Unity.ulua环境下如何生成lua的protobuf文件
来源:互联网 发布:想给自己淘宝店铺刷单 编辑:程序博客网 时间:2024/05/17 01:04
环境:
1. Unity 5.6
2. Lua: tolua# 1.0.6.293
使用的LuaFramework_UGUI插件 https://github.com/jarjin/LuaFramework_UGUI
3.ProtoBuf https://github.com/google/protobuf
4.protoc-gen-lua https://github.com/sean-lin/protoc-gen-lua
5.ProtoC https://github.com/google/protobuf/releases
6.Python 自行下载 并且配置环境变量
在各种更新到本地之后开始了以下的操作:
1. 把Protoc放到protobuf/src下
2. cmd进入到protobuf/python 执行以下命令
python setup.py build
python setup.py install
3 进入protoc-gen-lua/plugin 下面 新建一个protoc-gen-lua.bat 把以下内容填写进去,星号为protoc-gen-lua的路径
@python ****\protoc-gen-lua\plugin\protoc-gen-lua
注:
在每个protoc-gen-lua生成的lua文件里, 都有一行
local protobuf = require "protobuf"
本身按照官方出的没问题, 但是在ulua的目录里, 总是报protobuf找不到的错误. 前后对比了下我生成的lua和ulua官方生成的代码里
发现居然他修改了地址改为了
local protobuf = require "protobuf/protobuf"
好吧, 只有修改生成器代码protoc-gen-lua\plugin\protoc-gen-lua中第412行改为
lua('local protobuf = require "protobuf/protobuf"\n')
4. 进入Unity Packager.cs BuildProtobufFile函数
dir 修改为proto文件路径
protoc修改为 protobuf/src/protoc.exe
protoc_gen_dir 修改为protoc-gen-lua.bat的路径
5 unity 菜单LuaFramework/Build Protobuf-lua-gen File 点击生成
- 在Unity.ulua环境下如何生成lua的protobuf文件
- win环境下实现导出protobuf文件的lua版本
- 在lua环境中使用protobuf ,编译protobuf文件
- Lua的系统学习(杂)_使用uLua在Unity中创建一个Sphere小球
- [protobuf] 如何在Windows环境下的VS中安装使用Google Protobuf完成SOCKET通信
- 如何在unity中使用protobuf工具生成cs类
- windows lua使用protobuf 环境生成
- uLua最新的Unity+Lua热更新解决方案!!!
- uLua最新的Unity+Lua热更新解决方案
- uLua最新的Unity+Lua热更新解决方案!!!
- Mac 环境下编译Protobuf 生成多种语言文件
- protobuf在linux环境下c代码生成及测试
- 在lua环境中使用protobuf
- 在lua环境中使用protobuf
- 在lua环境中使用protobuf
- 在lua环境中使用protobuf
- 在lua环境中使用protobuf
- 在lua环境中使用protobuf
- 原来Live555 ProxyServer支持摄像机RTSP直播
- 关于tomcat启动闪退的解决
- poj 1724~ROADS(dijkstra+优先队列)
- 第四届 山东省ACM Contest Print Server
- 异步传输中的批量发送问题
- 在Unity.ulua环境下如何生成lua的protobuf文件
- 【2017.04.13】美团二面面经
- CodeForces
- jsoncpp判断Value中是否含有指定的key
- opengl丢弃缓存数据相关函数
- nginx学习4——nginx的几个配置文件学习nginx.conf、fastcgi.conf
- LeetCode : Perfect Number
- POJ2349 Arctic Network
- GreenDao3.0新特性解析(配置、注解、加密)