Protobuf 介绍
Protocol buffers are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. 【来自Protocol Buffers
介绍】
集成protobuf文件
在工程根目录下新建 tool 文件夹,其下主要安装工程所需各种 npm 包,用于将 .proto 文件生成对应 .js 和 .d.ts 文件。
进入 tool 文件夹下,运行以下命令:
npm init -y
npm i protobufjs
npm i @egret/protobuf
因为我们是将 protobufjs 和 @egret/protobuf 安装到本地工程,没有全局安装,所以需要在