首页 > 解决方案 > 我应该将 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/csharptutorialhttps://developers.google.com/protocol-buffers/docs/encodinghttps://developers.google .com/protocol-buffers/docs/reference/csharphttps: //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 之外使用脚本工具或原始编程语言。

标签: c#unity3dprotocol-buffersprotobuf-net

解决方案


推荐阅读