c# - 我应该将 Protobuf 与 Unity(或 protobu-net)一起使用吗?如果是这样,怎么做?
问题描述
我正在开发一个针对 Android 和 iOS 的应用程序,并且正在寻找数据序列化的替代方案。
我知道如何使用基本的二进制序列化,但通过搜索我发现它远不如其他库(如 Google Protobuf)最优。
这是真的?与 Unity 一起使用是否也是如此?
如果是这样,我如何在 Unity 中使用 Protobuf?我寻求的建议主要是“如何开始使用 protobuf”。我已经下载了 NuGet 包 Google.Protobuf 和 Google.Protobuf.Tools,但我不知道从那里去哪里。我检查了教程(https://developers.google.com/protocol-buffers/docs/csharptutorial,https://developers.google.com/protocol-buffers/docs/encoding,https://developers.google .com/protocol-buffers/docs/reference/csharp,https: //developers.google.com/protocol-buffers/docs/reference/csharp-generated,https ://developers.google.com/protocol-buffers/docs /proto3 , https://github.com/protobuf-net/protobuf-net) 但似乎没有人指出如何在 Unity 中实际开始使用缓冲区。
我在 Unity 中进行开发已经有一段时间了,但我从未在 Unity 之外进行过开发,也没有接受过正规的编程教育,所以我不太习惯在 Unity 之外使用脚本工具或原始编程语言。
解决方案
推荐阅读
- r - 文本挖掘中的错误:“替换长度为零”和“要替换的项目数不是替换长度的倍数”
- opengl - 为数组调用 OpenGL glGenXXX 函数是否比单个元素更优化?
- c++ - 使用 ostream 变量删除重复代码
- python - PyQt5:QtableView 是否有“changedselection”信号?
- java - 为什么我的 Android 应用程序在单击发送消息按钮后崩溃?
- ios - 低 SpriteKit FPS 会导致碰撞丢失?
- vue.js - 从 api 在 vue 中显示图像
- python - Celery - TypeError:字节类型的对象不是 JSON 可序列化的
- python - 如何将 div 类中的多个项目分成单独的列表?
- javascript - 获取格式错误的图像数据