使用方式

  1. 可以使用生产potobuf-lite.dll的方式引入到unity插件。
  2. 直接拖到protobuf的csharp源码到unity插件中,中间需要删除测试代码,有时编译不通过,可采用以下方式:在Assets目录下面新建 smcs.rsp文件,并在其中写入  -unsafe 字符串,前后不加空格。unity使用Protobuf小结
  3. 根据.proto生成C#语言,生成语句类似下面的语法(protoc以及lib的生成使用cmake)

    protoc -I=D:\13\protobuf\vsprojects\Debug --cpp_out=D:\13\protobuf\vsprojects\Debug D:\13\protobuf\vsprojects\Debug\Person.proto

    生成java用java_out城市c#用csharp_out

    或者直接在unity中编辑如下:

  4. unity使用Protobuf小结

  5.  

     

     

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-04-06
  • 2021-04-10
  • 2021-10-11
猜你喜欢
  • 2022-01-01
  • 2021-04-24
  • 2021-12-09
  • 2021-12-10
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
相关资源
相似解决方案